features/test_frameworks/rspec_metadata.feature in vcr-2.9.3 vs features/test_frameworks/rspec_metadata.feature in vcr-3.0.0
- old
+ new
@@ -1,5 +1,6 @@
+@with-bundler
Feature: Usage with RSpec metadata
VCR provides easy integration with RSpec using metadata. To set this
up, call `configure_rspec_metadata!` in your `VCR.configure` block.
@@ -55,39 +56,39 @@
"""
Scenario: Use `:vcr` metadata
Given a file named "spec/vcr_example_spec.rb" with:
"""ruby
- start_sinatra_app(:port => 7777) do
+ $server = start_sinatra_app do
get('/') { "Hello" }
end
def make_http_request
- Net::HTTP.get_response('localhost', '/', 7777).body
+ Net::HTTP.get_response('localhost', '/', $server.port).body
end
require 'spec_helper'
describe "VCR example group metadata", :vcr do
it 'records an http request' do
- make_http_request.should == 'Hello'
+ expect(make_http_request).to eq('Hello')
end
it 'records another http request' do
- make_http_request.should == 'Hello'
+ expect(make_http_request).to eq('Hello')
end
context 'in a nested example group' do
it 'records another one' do
- make_http_request.should == 'Hello'
+ expect(make_http_request).to eq('Hello')
end
end
end
describe "VCR example metadata" do
it 'records an http request', :vcr do
- make_http_request.should == 'Hello'
+ expect(make_http_request).to eq('Hello')
end
end
"""
When I run `rspec spec/vcr_example_spec.rb`
Then it should pass with "4 examples, 0 failures"
@@ -135,14 +136,14 @@
require 'spec_helper'
vcr_options = { :cassette_name => "example", :record => :new_episodes }
describe "Using an options hash", :vcr => vcr_options do
it 'uses the provided cassette name' do
- VCR.current_cassette.name.should == "example"
+ expect(VCR.current_cassette.name).to eq("example")
end
it 'sets the given options' do
- VCR.current_cassette.record_mode.should == :new_episodes
+ expect(VCR.current_cassette.record_mode).to eq(:new_episodes)
end
end
"""
When I run `rspec spec/vcr_example_spec.rb`
Then it should pass with "2 examples, 0 failures"