diff options
Diffstat (limited to 'spec/dispatch/adapter/interface/base_spec.rb')
| -rw-r--r-- | spec/dispatch/adapter/interface/base_spec.rb | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/spec/dispatch/adapter/interface/base_spec.rb b/spec/dispatch/adapter/interface/base_spec.rb index 8c3a279..f8b4a6e 100644 --- a/spec/dispatch/adapter/interface/base_spec.rb +++ b/spec/dispatch/adapter/interface/base_spec.rb @@ -7,6 +7,44 @@ RSpec.describe Dispatch::Adapter::Base do it "raises NotImplementedError" do expect { base.chat([]) }.to raise_error(NotImplementedError, /chat must be implemented/) end + + it "accepts system: as a String without raising" do + expect { base.chat([], system: "You are helpful.") }.to raise_error(NotImplementedError) + end + + it "accepts system: as an Array of TextBlock without raising" do + blocks = [Dispatch::Adapter::TextBlock.new(text: "prompt")] + expect { base.chat([], system: blocks) }.to raise_error(NotImplementedError) + end + + it "accepts tool_choice: without raising" do + expect { base.chat([], tool_choice: :auto) }.to raise_error(NotImplementedError) + expect { base.chat([], tool_choice: { type: :tool, name: "fn" }) }.to raise_error(NotImplementedError) + end + + it "accepts cache_retention: without raising" do + expect { base.chat([], cache_retention: :long) }.to raise_error(NotImplementedError) + end + + it "accepts metadata: without raising" do + expect { base.chat([], metadata: { user_id: "u1" }) }.to raise_error(NotImplementedError) + end + + it "accepts betas: as Array without raising" do + expect { base.chat([], betas: ["interleaved-thinking-2025-05-14"]) }.to raise_error(NotImplementedError) + end + + it "accepts betas: as String without raising" do + expect { base.chat([], betas: "interleaved-thinking-2025-05-14") }.to raise_error(NotImplementedError) + end + + it "accepts thinking: as String without raising" do + expect { base.chat([], thinking: "high") }.to raise_error(NotImplementedError) + end + + it "accepts thinking: as Hash without raising" do + expect { base.chat([], thinking: { enabled: true, budget_tokens: 10_000 }) }.to raise_error(NotImplementedError) + end end describe "#model_name" do @@ -38,4 +76,28 @@ RSpec.describe Dispatch::Adapter::Base do expect(base.max_context_tokens).to be_nil end end + + describe "#usage_report" do + it "returns nil" do + expect(base.usage_report).to be_nil + end + end + + describe "#authenticate!" do + it "returns nil" do + expect(base.authenticate!).to be_nil + end + end + + describe "#authenticated?" do + it "returns true" do + expect(base.authenticated?).to be(true) + end + end + + describe "#logout!" do + it "returns nil" do + expect(base.logout!).to be_nil + end + end end |
