Skip to content

Commit

Permalink
Updates Gemfile, actions
Browse files Browse the repository at this point in the history
  • Loading branch information
picandocodigo committed Sep 11, 2024
1 parent d80a249 commit 39d35ee
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 20 deletions.
1 change: 1 addition & 0 deletions .github/workflows/rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ jobs:
ruby-version: 2.7
- name: Run Rubocop
run: |
sudo apt-get install libcurl4-openssl-dev
bundle install
bundle exec rubocop
1 change: 1 addition & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
- name: Build and test with Rake
run: |
ruby -v
sudo apt-get install libcurl4-openssl-dev
bundle install
bundle exec rake spec:client
test-jruby:
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ gemspec

gem 'awesome_print'
gem 'byebug' unless defined?(JRUBY_VERSION)
gem 'faraday-patron'
gem 'rake'
gem 'rspec', '~> 3.9.0'
gem 'rspec_junit_formatter'
Expand Down
24 changes: 4 additions & 20 deletions spec/app-search/client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
let(:api_key) { 'api_key' }

context 'dependant on EnterpriseSearch' do
let(:ent_client) { Elastic::EnterpriseSearch::Client.new(host: host) }
let(:ent_client) { Elastic::EnterpriseSearch::Client.new(host: host, adapter: :net_http) }
let(:app_client) { ent_client.app_search }

it 'initializes an app search client' do
Expand All @@ -34,7 +34,7 @@
end

it 'sets up authentication during initialization' do
ent_client = Elastic::EnterpriseSearch::Client.new(host: host)
# ent_client = Elastic::EnterpriseSearch::Client.new(host: host)
app_client = ent_client.app_search(http_auth: api_key)
expect(app_client.http_auth).to eq api_key
end
Expand All @@ -46,7 +46,7 @@
end

context 'independent from EnterpriseSearch client' do
let(:app_client) { Elastic::EnterpriseSearch::AppSearch::Client.new(host: host) }
let(:app_client) { Elastic::EnterpriseSearch::AppSearch::Client.new(host: host, adapter: :net_http) }

it 'initializes a workplace search client' do
expect(app_client).not_to be nil
Expand All @@ -55,7 +55,7 @@
end

it 'sets up authentication during initialization' do
ent_client = Elastic::EnterpriseSearch::Client.new(host: host)
ent_client = Elastic::EnterpriseSearch::Client.new(host: host, adapter: :net_http)
app_client = ent_client.app_search(http_auth: api_key)
expect(app_client.http_auth).to eq api_key
end
Expand Down Expand Up @@ -90,28 +90,12 @@
let(:client) { described_class.new }
let(:adapter) { client.transport.transport.connections.all.first.connection.builder.adapter }

context 'when no adapter is specified' do
it 'uses Faraday NetHttp' do
expect(adapter).to eq Faraday::Adapter::NetHttp
end
end

context 'when the adapter is patron' do
let(:client) { described_class.new(adapter: :patron) }

it 'uses Faraday with the adapter' do
expect(adapter).to eq Faraday::Adapter::Patron
end
end

unless defined?(JRUBY_VERSION)
context 'when the adapter is typhoeus' do
let(:client) { described_class.new(adapter: :patron) }

it 'uses Faraday with the adapter' do
expect(adapter).to eq Faraday::Adapter::Patron
end
end
end
end
end

0 comments on commit 39d35ee

Please sign in to comment.