Skip to content

Commit

Permalink
Fix specs
Browse files Browse the repository at this point in the history
  • Loading branch information
d-m-u committed Feb 4, 2020
1 parent 524ec72 commit 1c1b3ba
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
15 changes: 7 additions & 8 deletions spec/lib/vcr/library_hooks/faraday_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

conn.builder.lock!
expect(conn.builder.handlers.last(2).map(&:klass)).to eq([
VCR::Middleware::Faraday,
Faraday::Adapter::NetHttp
Faraday::Response::Logger,
VCR::Middleware::Faraday
])
end

Expand All @@ -21,29 +21,28 @@

conn.builder.lock!
expect(conn.builder.handlers.last(2).map(&:klass)).to eq([
VCR::Middleware::Faraday,
Faraday::Adapter::NetHttp
Faraday::Request::UrlEncoded,
VCR::Middleware::Faraday
])
end

it 'does nothing if the VCR middleware has already been included' do
conn = Faraday.new(:url => 'http://sushi.com') do |builder|
builder.use VCR::Middleware::Faraday
builder.use Faraday::Response::Logger
builder.use Faraday::Adapter::NetHttp
builder.adapter Faraday.default_adapter
end

conn.builder.lock!
expect(conn.builder.handlers.map(&:klass)).to eq([
VCR::Middleware::Faraday,
Faraday::Response::Logger,
Faraday::Adapter::NetHttp
Faraday::Response::Logger
])
end

it 'prints a warning if the faraday connection stack contains a middleware after the HTTP adapter' do
conn = Faraday.new(:url => 'http://sushi.com') do |builder|
builder.use Faraday::Adapter::NetHttp
builder.adapter Faraday.default_adapter
builder.use Faraday::Response::Logger
end

Expand Down
4 changes: 2 additions & 2 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require "codeclimate-test-reporter"
CodeClimate::TestReporter.start
require 'simplecov'
SimpleCov.start

require "pry"
require "rspec"
Expand Down

0 comments on commit 1c1b3ba

Please sign in to comment.