Skip to content

Commit

Permalink
cleanup stray whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
JonRowe committed Mar 19, 2013
1 parent 73d7236 commit 6ac50f2
Show file tree
Hide file tree
Showing 27 changed files with 65 additions and 69 deletions.
2 changes: 1 addition & 1 deletion Changelog.md
Expand Up @@ -304,4 +304,4 @@ Bug fixes

* fixed regression that broke `obj.stub_chain(:a, :b => :c)`
* fixed regression that broke `obj.stub_chain(:a, :b) { :c }`
* `respond_to?` always returns true when using `as_null_object`
* `respond_to?` always returns true when using `as_null_object`
4 changes: 2 additions & 2 deletions DEV-README.md
Expand Up @@ -19,10 +19,10 @@ Or ...

bundle install --binstubs
bin/rspec

## Customize the dev enviroment

The Gemfile includes the gems you'll need to be able to run specs. If you want
to customize your dev enviroment with additional tools like guard or
ruby-debug, add any additional gem declarations to Gemfile-custom (see
Gemfile-custom.sample for some examples).
Gemfile-custom.sample for some examples).
4 changes: 2 additions & 2 deletions features/argument_matchers/README.md
Expand Up @@ -15,7 +15,7 @@ Argument matchers can be used:

#create a double
obj = double()

#expect a message with given args
obj.should_receive(:message).with('an argument')

Expand All @@ -24,4 +24,4 @@ If more control is needed, one can use a block
obj.should_receive(:message) do |arg1, arg2|
# set expectations about the args in this block
# and optionally set a return value
end
end
5 changes: 2 additions & 3 deletions features/argument_matchers/explicit.feature
Expand Up @@ -46,7 +46,7 @@ Feature: explicit arguments
object.foo(:this).should eq("got this")
object.foo(:this, :that).should eq("got this and that")
end
it "works on mocks" do
object = double('foo')
object.should_receive(:foo).with(:this, :that)
Expand All @@ -56,5 +56,4 @@ Feature: explicit arguments
end
"""
When I run `rspec stub_multiple_explicit_args_spec.rb`
Then the output should contain "2 examples, 0 failures"

Then the output should contain "2 examples, 0 failures"
4 changes: 2 additions & 2 deletions features/argument_matchers/general_matchers.feature
@@ -1,6 +1,6 @@
Feature: General matchers

The `anything`, `any_args`, and `no_args` matchers can be used to require the method
The `anything`, `any_args`, and `no_args` matchers can be used to require the method
to have arguments (or not) without constraining the details of the argument, such as its
type, pattern or value. The `anything` matcher only reflects a single argument, while
the `any_args` matcher matches any arity.
Expand Down Expand Up @@ -82,4 +82,4 @@ Feature: General matchers
end
"""
When I run `rspec stub_no_args_expectations_spec.rb`
Then the output should contain "2 examples, 1 failure"
Then the output should contain "2 examples, 1 failure"
7 changes: 3 additions & 4 deletions features/argument_matchers/type_matchers.feature
@@ -1,9 +1,9 @@
Feature: stub with argument constraints

You can further specify the behavior by constraining the type,
format and/or number of arguments with the `#with()` method
format and/or number of arguments with the `#with()` method
chained off of `#stub()`

Scenario: an_instance_of argument matcher
Given a file named "stub_an_instance_of_args_spec.rb" with:
"""ruby
Expand All @@ -23,5 +23,4 @@ Feature: stub with argument constraints
end
"""
When I run `rspec stub_an_instance_of_args_spec.rb`
Then the output should contain "1 example, 0 failures"

Then the output should contain "1 example, 0 failures"
4 changes: 2 additions & 2 deletions features/message_expectations/README.md
Expand Up @@ -37,7 +37,7 @@ You can also use the block format:
obj.should_receive(:message) { throw :this_symbol }

### Argument constraints

#### Explicit arguments

obj.should_receive(:message).with('an argument')
Expand All @@ -53,7 +53,7 @@ You can also use the block format:

obj.should_receive(:message).with(/abc/)

### Counts
### Counts

obj.should_receive(:message).once
obj.should_receive(:message).twice
Expand Down
4 changes: 2 additions & 2 deletions features/message_expectations/any_instance.feature
Expand Up @@ -2,7 +2,7 @@ Feature: expect a message on any instance of a class

Use `any_instance.should_receive` to set an expectation that one (and only
one) instance of a class receives a message before the example is completed.

The spec will fail if no instance receives a message.

Scenario: expect a message on any instance of a class
Expand All @@ -18,4 +18,4 @@ Feature: expect a message on any instance of a class
end
"""
When I run `rspec example_spec.rb`
Then the examples should all pass
Then the examples should all pass
Expand Up @@ -32,9 +32,9 @@ Feature: block local expectations
"""
When I run `rspec spec/account_spec.rb`
Then the output should contain "1 example, 0 failures"

Scenario: failing example

Given a file named "spec/account_spec.rb" with:
"""
require 'account'
Expand All @@ -52,4 +52,4 @@ Feature: block local expectations
"""

When I run `rspec spec/account_spec.rb`
Then the output should contain "1 example, 1 failure"
Then the output should contain "1 example, 1 failure"
2 changes: 1 addition & 1 deletion features/method_stubs/README.md
Expand Up @@ -30,7 +30,7 @@ You can also use the block format:
obj.stub(:message) { throw :this_symbol }

### Argument constraints

#### Explicit arguments

obj.stub(:message).with('an argument') { ... }
Expand Down
22 changes: 11 additions & 11 deletions features/method_stubs/any_instance.feature
Expand Up @@ -20,7 +20,7 @@ Feature: stub on any instance of a class
"""
When I run `rspec example_spec.rb`
Then the examples should all pass

Scenario: any_instance stub with a hash
Given a file named "example_spec.rb" with:
"""ruby
Expand All @@ -37,8 +37,8 @@ Feature: stub on any instance of a class
end
"""
When I run `rspec example_spec.rb`
Then the examples should all pass
Then the examples should all pass

Scenario: any_instance stub with specific arguments matchers
Given a file named "example_spec.rb" with:
"""ruby
Expand All @@ -47,7 +47,7 @@ Feature: stub on any instance of a class
it "returns the stubbed value when arguments match" do
Object.any_instance.stub(:foo).with(:param_one, :param_two).and_return(:result_one)
Object.any_instance.stub(:foo).with(:param_three, :param_four).and_return(:result_two)
o = Object.new
o.foo(:param_one, :param_two).should eq(:result_one)
o.foo(:param_three, :param_four).should eq(:result_two)
Expand All @@ -57,7 +57,7 @@ Feature: stub on any instance of a class
"""
When I run `rspec example_spec.rb`
Then the examples should all pass

Scenario: any_instance unstub
Given a file named "example_spec.rb" with:
"""ruby
Expand All @@ -68,7 +68,7 @@ Feature: stub on any instance of a class
:foo
end
end
Object.any_instance.stub(:foo)
Object.any_instance.unstub(:foo)
Expand All @@ -77,8 +77,8 @@ Feature: stub on any instance of a class
end
"""
When I run `rspec example_spec.rb`
Then the examples should all pass
Then the examples should all pass

Scenario: any_instance unstub
Given a file named "example_spec.rb" with:
"""ruby
Expand All @@ -93,15 +93,15 @@ Feature: stub on any instance of a class
Object.any_instance.should_receive(:foo).and_return(:bar)
Object.any_instance.stub(:foo)
Object.any_instance.unstub(:foo)
Object.new.foo.should eq(:bar)
end
end
end
"""
When I run `rspec example_spec.rb`
Then the examples should all pass

Scenario: stub a chain of methods an any instance
Given a file named "stub_chain_spec.rb" with:
"""ruby
Expand Down Expand Up @@ -129,4 +129,4 @@ Feature: stub on any instance of a class
end
"""
When I run `rspec stub_chain_spec.rb`
Then the examples should all pass
Then the examples should all pass
2 changes: 1 addition & 1 deletion features/method_stubs/as_null_object.feature
Expand Up @@ -6,7 +6,7 @@ Feature: as_null_object
EXCEPTION: `to_ary` will raise a NoMethodError unless explicitly stubbed in
order to support `flatten` on an Array containing a double.

Scenario: double acting as_null_object
Scenario: double acting as_null_object
Given a file named "as_null_object_spec.rb" with:
"""ruby
describe "a double with as_null_object called" do
Expand Down
4 changes: 2 additions & 2 deletions features/method_stubs/stub_implementation.feature
Expand Up @@ -2,7 +2,7 @@ Feature: stub with substitute implementation

You can stub an implementation of a method (a.k.a. fake) by passing a block
to the `stub` method.

Scenario: stub implementation
Given a file named "stub_implementation_spec.rb" with:
"""ruby
Expand All @@ -16,7 +16,7 @@ Feature: stub with substitute implementation
"got that"
end
end
object.foo(:this).should eq("got this")
object.foo(:that).should eq("got that")
end
Expand Down
4 changes: 2 additions & 2 deletions features/outside_rspec/configuration.feature
Expand Up @@ -15,10 +15,10 @@ Feature: configure any test framework to use rspec-mocks
should_receive
should_not_receive
stub

In order to give control to the consuming framework, none of these facilities
are added until RSpec::Mocks::setup(self) is called. Simply requiring
'rspec/mocks' is not sufficient.
'rspec/mocks' is not sufficient.

NOTICE: the stub() method that is added to the object passed to setup is not
the same stub() method that is added to every other object.
Expand Down
2 changes: 1 addition & 1 deletion lib/rspec/mocks/argument_list_matcher.rb
Expand Up @@ -30,7 +30,7 @@ class ArgumentListMatcher

# @api public
# @param [Array] *expected_args a list of expected literals and/or argument matchers
# @param [Block] block a block with arity matching the expected
# @param [Block] block a block with arity matching the expected
#
# Initializes an `ArgumentListMatcher` with a collection of literal
# values and/or argument matchers, or a block that handles the evaluation
Expand Down
3 changes: 1 addition & 2 deletions lib/rspec/mocks/error_generator.rb
Expand Up @@ -116,5 +116,4 @@ def pretty_print(count)

end
end
end

end
2 changes: 1 addition & 1 deletion lib/rspec/mocks/errors.rb
Expand Up @@ -3,7 +3,7 @@ module Mocks
# @private
class MockExpectationError < Exception
end

# @private
class AmbiguousReturnError < StandardError
end
Expand Down
2 changes: 1 addition & 1 deletion lib/rspec/mocks/method_double.rb
Expand Up @@ -255,7 +255,7 @@ def warn_if_nil_class

# @private
def raise_method_not_stubbed_error
raise MockExpectationError, "The method `#{method_name}` was not stubbed or was already unstubbed"
raise MockExpectationError, "The method `#{method_name}` was not stubbed or was already unstubbed"
end

# @private
Expand Down
2 changes: 1 addition & 1 deletion lib/rspec/mocks/methods.rb
Expand Up @@ -135,7 +135,7 @@ def __mock_proxy
mp
end
end

def __remove_mock_proxy
@mock_proxy = nil
end
Expand Down
3 changes: 1 addition & 2 deletions lib/rspec/mocks/mutate_const.rb
Expand Up @@ -411,5 +411,4 @@ def self.raise_on_invalid_const
# of both stubbing and hiding.
ConstantStubber = ConstantMutator
end
end

end
2 changes: 1 addition & 1 deletion lib/rspec/mocks/space.rb
Expand Up @@ -25,7 +25,7 @@ def expectation_ordering
end

private

def receivers
@receivers ||= []
end
Expand Down
8 changes: 4 additions & 4 deletions spec/rspec/mocks/bug_report_11545_spec.rb
Expand Up @@ -4,17 +4,17 @@ class LiarLiarPantsOnFire
def respond_to?(message, incl_private=false)
true
end

def self.respond_to?(message, incl_private=false)
true
end
end

describe 'should_receive' do
before(:each) do
@liar = LiarLiarPantsOnFire.new
end

it "works when object lies about responding to a method" do
@liar.should_receive(:something)
@liar.something
Expand All @@ -24,7 +24,7 @@ def self.respond_to?(message, incl_private=false)
LiarLiarPantsOnFire.should_receive(:something)
LiarLiarPantsOnFire.something
end

it 'cleans up after itself' do
expect((class << LiarLiarPantsOnFire; self; end).instance_methods).not_to include("something")
end
Expand Down
2 changes: 1 addition & 1 deletion spec/rspec/mocks/bug_report_600_spec.rb
Expand Up @@ -9,7 +9,7 @@ def self.method_that_uses_define_method
end
end
end

it "works" do
ExampleClass.should_receive(:define_method).with("defined_method")
ExampleClass.method_that_uses_define_method
Expand Down
2 changes: 1 addition & 1 deletion spec/rspec/mocks/bug_report_7611_spec.rb
Expand Up @@ -11,6 +11,6 @@ class Bar < Foo; end

it "should" do
expect(Bar.new.class).to eq Bar
end
end
end
end

0 comments on commit 6ac50f2

Please sign in to comment.