Skip to content

Commit 8db1639

Browse files
committed
Fix couple of errors in spec
1 parent 812cbea commit 8db1639

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

spec/openai/client/http_spec.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,13 @@
155155

156156
context "when OpenAI returns an HTTP error" do
157157
let(:chunk) { "{\"error\":{\"message\":\"A bad thing has happened!\"}}" }
158-
let(:env) { Faraday::Env.new(status: 500) }
158+
let(:env) do
159+
Faraday::Env.new(
160+
status: 500,
161+
url: URI::HTTPS.build(host: "api.openai.com"),
162+
request: Faraday::RequestOptions.new
163+
)
164+
end
159165

160166
it "does not raise an error and calls the user proc with the error parsed as JSON" do
161167
expect(user_proc).to receive(:call).with(

0 commit comments

Comments
 (0)