Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updated the spec messages to not use "should" for each message. It's …

…unnecessary noise.
  • Loading branch information...
commit 8c5dc921e1411bdd52d10f1aaff291ec2898b091 1 parent 29b8218
@myronmarston authored
View
32 spec/cassette_spec.rb
@@ -17,22 +17,22 @@
describe '#cache_file' do
temp_dir File.expand_path(File.dirname(__FILE__) + '/fixtures/cache_file'), :assign_to_cache_dir => true
- it 'should combine the cache_dir with the cassette name' do
+ it 'combines the cache_dir with the cassette name' do
cassette = VCR::Cassette.new('the_cache_file')
cassette.cache_file.should == File.join(VCR::Config.cache_dir, 'the_cache_file.yml')
end
- it 'should strip out disallowed characters so that it is a valid file name with no spaces' do
+ it 'strips out disallowed characters so that it is a valid file name with no spaces' do
cassette = VCR::Cassette.new("\nthis \t! is-the_13212_file name")
cassette.cache_file.should =~ /#{Regexp.escape('_this_is-the_13212_file_name.yml')}$/
end
- it 'should keep any path separators' do
+ it 'keeps any path separators' do
cassette = VCR::Cassette.new("dir/file_name")
cassette.cache_file.should =~ /#{Regexp.escape('dir/file_name.yml')}$/
end
- it 'should return nil if the cache_dir is not set' do
+ it 'returns nil if the cache_dir is not set' do
VCR::Config.cache_dir = nil
cassette = VCR::Cassette.new('the_cache_file')
cassette.cache_file.should be_nil
@@ -40,7 +40,7 @@
end
describe '#store_recorded_response!' do
- it 'should add the recorded response to #recorded_responses' do
+ it 'adds the recorded response to #recorded_responses' do
recorded_response = VCR::RecordedResponse.new(:get, 'http://example.com', :response)
cassette = VCR::Cassette.new(:test_cassette)
cassette.recorded_responses.should == []
@@ -50,12 +50,12 @@
end
describe 'on creation' do
- it "should raise an error if given an invalid record mode" do
+ it "raises an error if given an invalid record mode" do
lambda { VCR::Cassette.new(:test, :record => :not_a_record_mode) }.should raise_error(ArgumentError)
end
VCR::Cassette::VALID_RECORD_MODES.each do |mode|
- it "should default the record mode to #{mode} when VCR::Config.default_cassette_record_mode is #{mode}" do
+ it "defaults the record mode to #{mode} when VCR::Config.default_cassette_record_mode is #{mode}" do
VCR::Config.default_cassette_record_mode = mode
cassette = VCR::Cassette.new(:test)
cassette.record_mode.should == mode
@@ -63,7 +63,7 @@
end
{ :unregistered => true, :all => true, :none => false }.each do |record_mode, allow_fakeweb_connect|
- it "should set FakeWeb.allow_net_connect to #{allow_fakeweb_connect} when the record mode is #{record_mode}" do
+ it "sets FakeWeb.allow_net_connect to #{allow_fakeweb_connect} when the record mode is #{record_mode}" do
FakeWeb.allow_net_connect = !allow_fakeweb_connect
VCR::Cassette.new(:name, :record => record_mode)
FakeWeb.allow_net_connect?.should == allow_fakeweb_connect
@@ -71,7 +71,7 @@
end
{ :unregistered => true, :all => false, :none => true }.each do |record_mode, load_responses|
- it "should #{'not ' unless load_responses}load the recorded responses from the cached yml file when the record mode is #{record_mode}" do
+ it "#{load_responses ? 'loads' : 'does not load'} the recorded responses from the cached yml file when the record mode is #{record_mode}" do
VCR::Config.cache_dir = File.expand_path(File.dirname(__FILE__) + "/fixtures/#{RUBY_VERSION}/cassette_spec")
cassette = VCR::Cassette.new('example', :record => record_mode)
@@ -92,7 +92,7 @@
end
end
- it "should #{'not ' unless load_responses}register the recorded responses with fakeweb when the record mode is #{record_mode}" do
+ it "#{load_responses ? 'registers' : 'does not register'} the recorded responses with fakeweb when the record mode is #{record_mode}" do
VCR::Config.cache_dir = File.expand_path(File.dirname(__FILE__) + "/fixtures/#{RUBY_VERSION}/cassette_spec")
cassette = VCR::Cassette.new('example', :record => record_mode)
@@ -116,7 +116,7 @@
temp_dir File.expand_path(File.dirname(__FILE__) + '/fixtures/cassette_spec_destroy'), :assign_to_cache_dir => true
[true, false].each do |orig_allow_net_connect|
- it "should reset FakeWeb.allow_net_connect #{orig_allow_net_connect} if it was originally #{orig_allow_net_connect}" do
+ it "resets FakeWeb.allow_net_connect #{orig_allow_net_connect} if it was originally #{orig_allow_net_connect}" do
FakeWeb.allow_net_connect = orig_allow_net_connect
cassette = VCR::Cassette.new(:name)
cassette.destroy!
@@ -124,7 +124,7 @@
end
end
- it "should write the recorded responses to disk as yaml" do
+ it "writes the recorded responses to disk as yaml" do
recorded_responses = [
VCR::RecordedResponse.new(:get, 'http://example.com', :get_example_dot_come_response),
VCR::RecordedResponse.new(:post, 'http://example.com', :post_example_dot_come_response),
@@ -139,7 +139,7 @@
saved_recorded_responses.should == recorded_responses
end
- it "should write the recorded responses a subdirectory if the cassette name includes a directory" do
+ it "writes the recorded responses a subdirectory if the cassette name includes a directory" do
recorded_responses = [VCR::RecordedResponse.new(:get, 'http://example.com', :get_example_dot_come_response)]
cassette = VCR::Cassette.new('subdirectory/test_cassette')
cassette.stub!(:recorded_responses).and_return(recorded_responses)
@@ -149,7 +149,7 @@
saved_recorded_responses.should == recorded_responses
end
- it "should write both old and new recorded responses to disk" do
+ it "writes both old and new recorded responses to disk" do
cache_file = File.expand_path(File.dirname(__FILE__) + "/fixtures/#{RUBY_VERSION}/cassette_spec/example.yml")
FileUtils.cp cache_file, File.join(@temp_dir, 'previously_recorded_responses.yml')
cassette = VCR::Cassette.new('previously_recorded_responses')
@@ -164,7 +164,7 @@
end
describe '#destroy for a cassette with previously recorded responses' do
- it "should de-register the recorded responses from fakeweb" do
+ it "de-registers the recorded responses from fakeweb" do
VCR::Config.cache_dir = File.expand_path(File.dirname(__FILE__) + "/fixtures/#{RUBY_VERSION}/cassette_spec")
cassette = VCR::Cassette.new('example', :record => :none)
FakeWeb.registered_uri?(:get, 'http://example.com').should be_true
@@ -174,7 +174,7 @@
FakeWeb.registered_uri?(:get, 'http://example.com/foo').should be_false
end
- it "should not re-write to disk the previously recorded resposes if there are no new ones" do
+ it "does not re-write to disk the previously recorded resposes if there are no new ones" do
VCR::Config.cache_dir = File.expand_path(File.dirname(__FILE__) + "/fixtures/#{RUBY_VERSION}/cassette_spec")
yaml_file = File.join(VCR::Config.cache_dir, 'example.yml')
cassette = VCR::Cassette.new('example', :record => :none)
View
8 spec/config_spec.rb
@@ -4,23 +4,23 @@
describe '#cache_dir=' do
temp_dir(File.expand_path(File.dirname(__FILE__) + '/fixtures/config_spec'))
- it 'should create the directory if it does not exist' do
+ it 'creates the directory if it does not exist' do
lambda { VCR::Config.cache_dir = @temp_dir }.should change { File.exist?(@temp_dir) }.from(false).to(true)
end
- it 'should not raise an error if given nil' do
+ it 'does not raise an error if given nil' do
lambda { VCR::Config.cache_dir = nil }.should_not raise_error
end
end
describe '#default_cassette_record_mode' do
VCR::Cassette::VALID_RECORD_MODES.each do |mode|
- it "should allow #{mode}" do
+ it "allows #{mode}" do
lambda { VCR::Config.default_cassette_record_mode = mode }.should_not raise_error
end
end
- it "should not allow :not_a_record_mode" do
+ it "does not allow :not_a_record_mode" do
lambda { VCR::Config.default_cassette_record_mode = :not_a_record_mode }.should raise_error(ArgumentError)
end
end
View
6 spec/cucumber_tags_spec.rb
@@ -18,7 +18,7 @@ def After(*args, &block)
describe '#tag' do
[:before, :after].each do |hook|
- it "should set up a cucumber #{hook} hook for the given tag that creates a new cassette" do
+ it "sets up a cucumber #{hook} hook for the given tag that creates a new cassette" do
VCR.cucumber_tags { |t| t.tag 'tag_test' }
@args[hook].should == [['@tag_test']]
@@ -32,7 +32,7 @@ def After(*args, &block)
@blocks[hook].first.call
end
- it "should set up separate hooks for each tag, passing the given options to each cassette" do
+ it "sets up separate hooks for each tag, passing the given options to each cassette" do
VCR.cucumber_tags { |t| t.tag 'tag_test1', 'tag_test2', :record => :none }
@args[hook].should == [['@tag_test1'], ['@tag_test2']]
@@ -46,7 +46,7 @@ def After(*args, &block)
@blocks[hook].each { |b| b.call }
end
- it "should work with tags that start with an @" do
+ it "works with tags that start with an @" do
VCR.cucumber_tags { |t| t.tag '@tag_test' }
@args[hook].should == [['@tag_test']]
View
6 spec/fake_web_extensions_spec.rb
@@ -9,16 +9,16 @@
@remove_example_dot_com = lambda { FakeWeb.remove_from_registry(:get, 'http://example.com') }
end
- it "should remove the :get http://example.com registration" do
+ it "removes the :get http://example.com registration" do
@remove_example_dot_com.should change { FakeWeb.registered_uri?(:get, 'http://example.com') }.from(true).to(false)
end
- it "should not remove the :post http://example.com registration" do
+ it "does not remove the :post http://example.com registration" do
FakeWeb.registered_uri?(:post, 'http://example.com').should be_true
@remove_example_dot_com.should_not change { FakeWeb.registered_uri?(:post, 'http://example.com') }
end
- it "should not affect other registered uris" do
+ it "does not affect other registered uris" do
FakeWeb.registered_uri?(:get, 'http://google.com').should be_true
@remove_example_dot_com.should_not change { FakeWeb.registered_uri?(:get, 'http://google.com') }
end
View
6 spec/net_http_extensions_spec.rb
@@ -17,21 +17,21 @@
end
describe 'a request that is not registered with FakeWeb' do
- it 'should call #store_recorded_response! on the current cassette' do
+ it 'calls #store_recorded_response! on the current cassette' do
recorded_response = VCR::RecordedResponse.new(:get, 'http://example.com:80/', :example_response)
VCR::RecordedResponse.should_receive(:new).with(:get, 'http://example.com:80/', an_instance_of(Net::HTTPOK)).and_return(recorded_response)
@current_cassette.should_receive(:store_recorded_response!).with(recorded_response)
Net::HTTP.get(URI.parse('http://example.com'))
end
- it 'should not have an error if there is no current cassette' do
+ it 'does not have an error if there is no current cassette' do
VCR.stub!(:current_cassette).and_return(nil)
lambda { Net::HTTP.get(URI.parse('http://example.com')) }.should_not raise_error
end
end
describe 'a request that is registered with FakeWeb' do
- it 'should not call #store_recorded_response! on the current cassette' do
+ it 'does not call #store_recorded_response! on the current cassette' do
FakeWeb.register_uri(:get, 'http://example.com', :body => 'example.com response')
@current_cassette.should_not_receive(:store_recorded_response!)
Net::HTTP.get(URI.parse('http://example.com'))
View
8 spec/recorded_response_spec.rb
@@ -6,19 +6,19 @@
@r1 = VCR::RecordedResponse.new(:get, 'http://example.com', :the_example_dot_come_response)
end
- it 'should return true for 2 responses with the same method, uri and response' do
+ it 'returns true for 2 responses with the same method, uri and response' do
@r1.should == VCR::RecordedResponse.new(@r1.method, @r1.uri, @r1.response)
end
- it 'should return false for 2 responses with different methods' do
+ it 'returns false for 2 responses with different methods' do
@r1.should_not == VCR::RecordedResponse.new(:post, @r1.uri, @r1.response)
end
- it 'should return false for 2 responses with different uris' do
+ it 'returns false for 2 responses with different uris' do
@r1.should_not == VCR::RecordedResponse.new(@r1.method, 'http://example.com/path', @r1.response)
end
- it 'should return false for 2 responses with different responses' do
+ it 'returns false for 2 responses with different responses' do
@r1.should_not == VCR::RecordedResponse.new(@r1.method, @r1.uri, :another_response)
end
end
View
22 spec/vcr_spec.rb
@@ -15,11 +15,11 @@ def create_cassette
end
describe 'create_cassette!' do
- it 'should create a new cassette' do
+ it 'creates a new cassette' do
create_cassette.should be_instance_of(VCR::Cassette)
end
- it 'should take over as the #current_cassette' do
+ it 'takes over as the #current_cassette' do
orig_cassette = VCR.current_cassette
new_cassette = create_cassette
new_cassette.should_not == orig_cassette
@@ -32,49 +32,49 @@ def destroy_cassette
VCR.destroy_cassette!
end
- it 'should destroy the current sandbo' do
+ it 'destroys the current sandbo' do
cassette = create_cassette
cassette.should_receive(:destroy!)
VCR.destroy_cassette!
end
- it 'should return the destroyed cassette' do
+ it 'returns the destroyed cassette' do
cassette = create_cassette
VCR.destroy_cassette!.should == cassette
end
- it 'should return the #current_cassette to the previous one' do
+ it 'returns the #current_cassette to the previous one' do
cassette1, cassette2 = create_cassette, create_cassette
lambda { VCR.destroy_cassette! }.should change(VCR, :current_cassette).from(cassette2).to(cassette1)
end
end
describe 'with_cassette' do
- it 'should create a new cassette' do
+ it 'creates a new cassette' do
new_cassette = VCR::Cassette.new(:with_cassette_test)
VCR.should_receive(:create_cassette!).and_return(new_cassette)
VCR.with_cassette(:cassette_test) { }
end
- it 'should yield' do
+ it 'yields' do
yielded = false
VCR.with_cassette(:cassette_test) { yielded = true }
yielded.should be_true
end
- it 'should destroy the cassette' do
+ it 'destroys the cassette' do
VCR.should_receive(:destroy_cassette!)
VCR.with_cassette(:cassette_test) { }
end
- it 'should destroy the cassette even if there is an error' do
+ it 'destroys the cassette even if there is an error' do
VCR.should_receive(:destroy_cassette!)
lambda { VCR.with_cassette(:cassette_test) { raise StandardError } }.should raise_error
end
end
describe 'config' do
- it 'should yield the configuration object' do
+ it 'yields the configuration object' do
yielded_object = nil
VCR.config do |obj|
yielded_object = obj
@@ -84,7 +84,7 @@ def destroy_cassette
end
describe 'cucumber_tags' do
- it 'should yield a cucumber tags object' do
+ it 'yields a cucumber tags object' do
yielded_object = nil
VCR.cucumber_tags do |obj|
yielded_object = obj
Please sign in to comment.
Something went wrong with that request. Please try again.