File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed
Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,10 @@ def initialize(fallback: nil)
5656 self . fallback = fallback
5757 end
5858
59+ def client?
60+ !!( openrouter_client || openai_client )
61+ end
62+
5963 private
6064
6165 attr_accessor :fallback
Original file line number Diff line number Diff line change 1+ RSpec . describe Raix ::Configuration do
2+ describe "#client?" do
3+ context "with an openrouter_client" do
4+ it "returns true" do
5+ configuration = Raix ::Configuration . new
6+ configuration . openrouter_client = OpenRouter ::Client . new
7+ expect ( configuration . client? ) . to eq true
8+ end
9+ end
10+
11+ context "with an openai_client" do
12+ it "returns true" do
13+ configuration = Raix ::Configuration . new
14+ configuration . openai_client = OpenAI ::Client . new
15+ expect ( configuration . client? ) . to eq true
16+ end
17+ end
18+
19+ context "without an api client" do
20+ it "returns false" do
21+ configuration = Raix ::Configuration . new
22+ expect ( configuration . client? ) . to eq false
23+ end
24+ end
25+ end
26+ end
You can’t perform that action at this time.
0 commit comments