Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use HEAD instead of GET to ping Colore #26

Merged
merged 1 commit into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/colore/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def generate_doc_id
# Tests the connection with Colore. Will raise an error if the connection cannot be
# established.
def ping
send_request :get, '/'
send_request :head, '/'
true
end

Expand Down
63 changes: 14 additions & 49 deletions spec/fixtures/cassettes/Colore_Client/_ping/runs.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion spec/lib/colore/client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
end

it 'raises ColoreUnavailable on ECONNREFUSED' do
allow(client.send(:connection)).to receive(:get) { raise Faraday::ConnectionFailed }
allow(client.send(:connection)).to receive(:head) { raise Faraday::ConnectionFailed }
expect { client.ping }.to raise_error(Colore::Errors::ColoreUnavailable)
end
end
Expand Down
Loading