Skip to content

Commit

Permalink
Remove 'should' from example docstrings
Browse files Browse the repository at this point in the history
- Closes rspec#11.
  • Loading branch information
justinko authored and dchelimsky committed Aug 14, 2010
1 parent 2d7bc36 commit 20194cf
Show file tree
Hide file tree
Showing 32 changed files with 273 additions and 273 deletions.
8 changes: 4 additions & 4 deletions spec/rspec/mocks/any_number_of_times_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,23 @@ module Mocks
@mock = RSpec::Mocks::Mock.new("test mock")
end

it "should pass if any number of times method is called many times" do
it "passes if any number of times method is called many times" do
@mock.should_receive(:random_call).any_number_of_times
(1..10).each do
@mock.random_call
end
end

it "should pass if any number of times method is called once" do
it "passes if any number of times method is called once" do
@mock.should_receive(:random_call).any_number_of_times
@mock.random_call
end

it "should pass if any number of times method is not called" do
it "passes if any number of times method is not called" do
@mock.should_receive(:random_call).any_number_of_times
end

it "should return the mocked value when called after a similar stub" do
it "returns the mocked value when called after a similar stub" do
@mock.stub(:message).and_return :stub_value
@mock.should_receive(:message).any_number_of_times.and_return(:mock_value)
@mock.message.should == :mock_value
Expand Down
4 changes: 2 additions & 2 deletions spec/rspec/mocks/argument_expectation_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
module RSpec
module Mocks
describe ArgumentExpectation do
it "should consider an object that responds to #matches? and #description to be a matcher" do
it "considers an object that responds to #matches? and #description to be a matcher" do
argument_expecatation = RSpec::Mocks::ArgumentExpectation.new
obj = double("matcher")
obj.should_receive(:respond_to?).with(:matches?).and_return(true)
obj.should_receive(:respond_to?).with(:description).and_return(true)
argument_expecatation.is_matcher?(obj).should be_true
end

it "should NOT consider an object that only responds to #matches? to be a matcher" do
it "does NOT consider an object that only responds to #matches? to be a matcher" do
argument_expecatation = RSpec::Mocks::ArgumentExpectation.new
obj = double("matcher")
obj.should_receive(:respond_to?).with(:matches?).and_return(true)
Expand Down
22 changes: 11 additions & 11 deletions spec/rspec/mocks/at_least_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ module Mocks
@mock = RSpec::Mocks::Mock.new("test mock")
end

it "should fail if method is never called" do
it "fails if method is never called" do
@mock.should_receive(:random_call).at_least(4).times
lambda do
@mock.rspec_verify
end.should raise_error(RSpec::Mocks::MockExpectationError)
end

it "should fail when called less than n times" do
it "fails when called less than n times" do
@mock.should_receive(:random_call).at_least(4).times
@mock.random_call
@mock.random_call
Expand All @@ -24,29 +24,29 @@ module Mocks
end.should raise_error(RSpec::Mocks::MockExpectationError)
end

it "should fail when at least once method is never called" do
it "fails when at least once method is never called" do
@mock.should_receive(:random_call).at_least(:once)
lambda do
@mock.rspec_verify
end.should raise_error(RSpec::Mocks::MockExpectationError)
end

it "should fail when at least twice method is called once" do
it "fails when at least twice method is called once" do
@mock.should_receive(:random_call).at_least(:twice)
@mock.random_call
lambda do
@mock.rspec_verify
end.should raise_error(RSpec::Mocks::MockExpectationError)
end

it "should fail when at least twice method is never called" do
it "fails when at least twice method is never called" do
@mock.should_receive(:random_call).at_least(:twice)
lambda do
@mock.rspec_verify
end.should raise_error(RSpec::Mocks::MockExpectationError)
end

it "should pass when at least n times method is called exactly n times" do
it "passes when at least n times method is called exactly n times" do
@mock.should_receive(:random_call).at_least(4).times
@mock.random_call
@mock.random_call
Expand All @@ -55,7 +55,7 @@ module Mocks
@mock.rspec_verify
end

it "should pass when at least n times method is called n plus 1 times" do
it "passes when at least n times method is called n plus 1 times" do
@mock.should_receive(:random_call).at_least(4).times
@mock.random_call
@mock.random_call
Expand All @@ -65,28 +65,28 @@ module Mocks
@mock.rspec_verify
end

it "should pass when at least once method is called once" do
it "passes when at least once method is called once" do
@mock.should_receive(:random_call).at_least(:once)
@mock.random_call
@mock.rspec_verify
end

it "should pass when at least once method is called twice" do
it "passes when at least once method is called twice" do
@mock.should_receive(:random_call).at_least(:once)
@mock.random_call
@mock.random_call
@mock.rspec_verify
end

it "should pass when at least twice method is called three times" do
it "passes when at least twice method is called three times" do
@mock.should_receive(:random_call).at_least(:twice)
@mock.random_call
@mock.random_call
@mock.random_call
@mock.rspec_verify
end

it "should pass when at least twice method is called twice" do
it "passes when at least twice method is called twice" do
@mock.should_receive(:random_call).at_least(:twice)
@mock.random_call
@mock.random_call
Expand Down
22 changes: 11 additions & 11 deletions spec/rspec/mocks/at_most_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module Mocks
@mock = RSpec::Mocks::Mock.new("test mock")
end

it "should fail when at most n times method is called n plus 1 times" do
it "fails when at most n times method is called n plus 1 times" do
@mock.should_receive(:random_call).at_most(4).times
@mock.random_call
@mock.random_call
Expand All @@ -19,7 +19,7 @@ module Mocks
end.should raise_error(RSpec::Mocks::MockExpectationError)
end

it "should fail when at most once method is called twice" do
it "fails when at most once method is called twice" do
@mock.should_receive(:random_call).at_most(:once)
@mock.random_call
@mock.random_call
Expand All @@ -28,7 +28,7 @@ module Mocks
end.should raise_error(RSpec::Mocks::MockExpectationError)
end

it "should fail when at most twice method is called three times" do
it "fails when at most twice method is called three times" do
@mock.should_receive(:random_call).at_most(:twice)
@mock.random_call
@mock.random_call
Expand All @@ -38,7 +38,7 @@ module Mocks
end.should raise_error(RSpec::Mocks::MockExpectationError)
end

it "should pass when at most n times method is called exactly n times" do
it "passes when at most n times method is called exactly n times" do
@mock.should_receive(:random_call).at_most(4).times
@mock.random_call
@mock.random_call
Expand All @@ -47,44 +47,44 @@ module Mocks
@mock.rspec_verify
end

it "should pass when at most n times method is called less than n times" do
it "passes when at most n times method is called less than n times" do
@mock.should_receive(:random_call).at_most(4).times
@mock.random_call
@mock.random_call
@mock.random_call
@mock.rspec_verify
end

it "should pass when at most n times method is never called" do
it "passes when at most n times method is never called" do
@mock.should_receive(:random_call).at_most(4).times
@mock.rspec_verify
end

it "should pass when at most once method is called once" do
it "passes when at most once method is called once" do
@mock.should_receive(:random_call).at_most(:once)
@mock.random_call
@mock.rspec_verify
end

it "should pass when at most once method is never called" do
it "passes when at most once method is never called" do
@mock.should_receive(:random_call).at_most(:once)
@mock.rspec_verify
end

it "should pass when at most twice method is called once" do
it "passes when at most twice method is called once" do
@mock.should_receive(:random_call).at_most(:twice)
@mock.random_call
@mock.rspec_verify
end

it "should pass when at most twice method is called twice" do
it "passes when at most twice method is called twice" do
@mock.should_receive(:random_call).at_most(:twice)
@mock.random_call
@mock.random_call
@mock.rspec_verify
end

it "should pass when at most twice method is never called" do
it "passes when at most twice method is never called" do
@mock.should_receive(:random_call).at_most(:twice)
@mock.rspec_verify
end
Expand Down
2 changes: 1 addition & 1 deletion spec/rspec/mocks/bug_report_10260_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'spec_helper'

describe "An RSpec Mock" do
it "should hide internals in its inspect representation" do
it "hides internals in its inspect representation" do
m = double('cup')
m.inspect.should =~ /#<RSpec::Mocks::Mock:0x[a-f0-9.]+ @name="cup">/
end
Expand Down
6 changes: 3 additions & 3 deletions spec/rspec/mocks/bug_report_11545_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ def self.respond_to?(sym, incl_private=false)
@liar = LiarLiarPantsOnFire.new
end

it "should work when object lies about responding to a method" do
it "works when object lies about responding to a method" do
@liar.should_receive(:something)
@liar.something
end

it 'should work when class lies about responding to a method' do
it 'works when class lies about responding to a method' do
LiarLiarPantsOnFire.should_receive(:something)
LiarLiarPantsOnFire.something
end

it 'should cleanup after itself' do
it 'cleans up after itself' do
(class << LiarLiarPantsOnFire; self; end).instance_methods.should_not include("something")
end
end
Expand Down
4 changes: 2 additions & 2 deletions spec/rspec/mocks/bug_report_15719_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module RSpec
module Mocks
describe "mock failure" do

it "should tell you when it receives the right message with the wrong args" do
it "tells you when it receives the right message with the wrong args" do
double = double("foo")
double.should_receive(:bar).with("message")
lambda {
Expand All @@ -13,7 +13,7 @@ module Mocks
double.rspec_reset # so the example doesn't fail
end

pending "should tell you when it receives the right message with the wrong args if you stub the method (fix bug 15719)" do
pending "tells you when it receives the right message with the wrong args if you stub the method (fix bug 15719)" do
# NOTE - for whatever reason, if you use a the block style of pending here,
# rcov gets unhappy. Don't know why yet.
double = double("foo")
Expand Down
4 changes: 2 additions & 2 deletions spec/rspec/mocks/bug_report_600_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ def self.method_that_uses_define_method
end
end

it "should work" do
it "works" do
ExampleClass.should_receive(:define_method).with("defined_method")
ExampleClass.method_that_uses_define_method
end

it "should restore the original method" do
it "restores the original method" do
ExampleClass.method_that_uses_define_method
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/rspec/mocks/bug_report_7611_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Foo

class Bar < Foo
end
it "should respect subclasses" do
it "respects subclasses" do
Foo.stub(:new).and_return(Object.new)
end

Expand Down
4 changes: 2 additions & 2 deletions spec/rspec/mocks/bug_report_8165_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
# The fix was to keep track of whether :respond_to? had been proxied and, if
# so, call the munged copy of :respond_to? on the object.

it "should not raise an exception for Object" do
it "does not raise an exception for Object" do
obj = Object.new
obj.should_receive(:respond_to?).with(:foobar).and_return(true)
obj.should_receive(:foobar).and_return(:baz)
obj.respond_to?(:foobar).should be_true
obj.foobar.should == :baz
end

it "should not raise an exception for mock" do
it "does not raise an exception for mock" do
obj = double("obj")
obj.should_receive(:respond_to?).with(:foobar).and_return(true)
obj.should_receive(:foobar).and_return(:baz)
Expand Down
4 changes: 2 additions & 2 deletions spec/rspec/mocks/bug_report_957_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ module Mocks
@base_class.stub(:find).and_return "stubbed_value"
end

it "should return the value for the stub on the base class" do
it "returns the value for the stub on the base class" do
@base_class.find.should == "stubbed_value"
end

it "should return the value for the descendent class" do
it "returns the value for the descendent class" do
@concrete_class.find.should == "stubbed_value"
end
end
Expand Down
Loading

0 comments on commit 20194cf

Please sign in to comment.