Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #244 from JonRowe/cleanup_whitespace

Cleanup stray whitespace
  • Loading branch information...
commit 42a175e1b932a14958c005501fe98a599a0ef3ca 2 parents 1461794 + 6ac50f2
@myronmarston myronmarston authored
Showing with 62 additions and 66 deletions.
  1. +2 −2 DEV-README.md
  2. +2 −2 features/argument_matchers/README.md
  3. +2 −3 features/argument_matchers/explicit.feature
  4. +2 −2 features/argument_matchers/general_matchers.feature
  5. +3 −4 features/argument_matchers/type_matchers.feature
  6. +2 −2 features/message_expectations/README.md
  7. +2 −2 features/message_expectations/any_instance.feature
  8. +3 −3 features/message_expectations/block_local_expectations.feature.pending
  9. +1 −1  features/method_stubs/README.md
  10. +11 −11 features/method_stubs/any_instance.feature
  11. +1 −1  features/method_stubs/as_null_object.feature
  12. +2 −2 features/method_stubs/stub_implementation.feature
  13. +2 −2 features/outside_rspec/configuration.feature
  14. +1 −1  lib/rspec/mocks/argument_list_matcher.rb
  15. +1 −2  lib/rspec/mocks/error_generator.rb
  16. +1 −1  lib/rspec/mocks/errors.rb
  17. +1 −1  lib/rspec/mocks/method_double.rb
  18. +1 −2  lib/rspec/mocks/mutate_const.rb
  19. +4 −4 spec/rspec/mocks/bug_report_11545_spec.rb
  20. +1 −1  spec/rspec/mocks/bug_report_600_spec.rb
  21. +1 −1  spec/rspec/mocks/bug_report_7611_spec.rb
  22. +13 −13 spec/rspec/mocks/hash_excluding_matcher_spec.rb
  23. +1 −1  spec/rspec/mocks/mock_space_spec.rb
  24. +2 −2 specs.watchr
View
4 DEV-README.md
@@ -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).
View
4 features/argument_matchers/README.md
@@ -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')
@@ -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
View
5 features/argument_matchers/explicit.feature
@@ -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)
@@ -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"
View
4 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.
@@ -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"
View
7 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
@@ -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"
View
4 features/message_expectations/README.md
@@ -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')
@@ -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
View
4 features/message_expectations/any_instance.feature
@@ -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
@@ -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
View
6 features/message_expectations/block_local_expectations.feature.pending
@@ -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'
@@ -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"
View
2  features/method_stubs/README.md
@@ -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') { ... }
View
22 features/method_stubs/any_instance.feature
@@ -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
@@ -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
@@ -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)
@@ -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
@@ -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)
@@ -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
@@ -93,7 +93,7 @@ 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
@@ -101,7 +101,7 @@ Feature: stub on any instance of a class
"""
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
@@ -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
View
2  features/method_stubs/as_null_object.feature
@@ -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
View
4 features/method_stubs/stub_implementation.feature
@@ -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
@@ -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
View
4 features/outside_rspec/configuration.feature
@@ -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.
View
2  lib/rspec/mocks/argument_list_matcher.rb
@@ -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
View
3  lib/rspec/mocks/error_generator.rb
@@ -116,5 +116,4 @@ def pretty_print(count)
end
end
-end
-
+end
View
2  lib/rspec/mocks/errors.rb
@@ -3,7 +3,7 @@ module Mocks
# @private
class MockExpectationError < Exception
end
-
+
# @private
class AmbiguousReturnError < StandardError
end
View
2  lib/rspec/mocks/method_double.rb
@@ -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
View
3  lib/rspec/mocks/mutate_const.rb
@@ -411,5 +411,4 @@ def self.raise_on_invalid_const
# of both stubbing and hiding.
ConstantStubber = ConstantMutator
end
-end
-
+end
View
8 spec/rspec/mocks/bug_report_11545_spec.rb
@@ -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
@@ -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
View
2  spec/rspec/mocks/bug_report_600_spec.rb
@@ -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
View
2  spec/rspec/mocks/bug_report_7611_spec.rb
@@ -11,6 +11,6 @@ class Bar < Foo; end
it "should" do
expect(Bar.new.class).to eq Bar
- end
+ end
end
end
View
26 spec/rspec/mocks/hash_excluding_matcher_spec.rb
@@ -4,20 +4,20 @@ module RSpec
module Mocks
module ArgumentMatchers
describe HashExcludingMatcher do
-
+
it "describes itself properly" do
expect(HashExcludingMatcher.new(:a => 5).description).to eq "hash_not_including(:a=>5)"
- end
+ end
describe "passing" do
it "matches a hash without the specified key" do
expect(hash_not_including(:c)).to eq({:a => 1, :b => 2})
end
-
+
it "matches a hash with the specified key, but different value" do
expect(hash_not_including(:b => 3)).to eq({:a => 1, :b => 2})
end
-
+
it "matches a hash without the specified key, given as anything()" do
expect(hash_not_including(:c => anything)).to eq({:a => 1, :b => 2})
end
@@ -25,38 +25,38 @@ module ArgumentMatchers
it "matches an empty hash" do
expect(hash_not_including(:a)).to eq({})
end
-
+
it "matches a hash without any of the specified keys" do
expect(hash_not_including(:a, :b, :c)).to eq(:d => 7)
end
-
+
end
-
+
describe "failing" do
it "does not match a non-hash" do
expect(hash_not_including(:a => 1)).not_to eq 1
end
-
+
it "does not match a hash with a specified key" do
expect(hash_not_including(:b)).not_to eq(:b => 2)
end
-
+
it "does not match a hash with the specified key/value pair" do
expect(hash_not_including(:b => 2)).not_to eq(:a => 1, :b => 2)
end
-
+
it "does not match a hash with the specified key" do
expect(hash_not_including(:a, :b => 3)).not_to eq(:a => 1, :b => 2)
end
-
+
it "does not match a hash with one of the specified keys" do
expect(hash_not_including(:a, :b)).not_to eq(:b => 2)
end
-
+
it "does not match a hash with some of the specified keys" do
expect(hash_not_including(:a, :b, :c)).not_to eq(:a => 1, :b => 2)
end
-
+
it "does not match a hash with one key/value pair included" do
expect(hash_not_including(:a, :b, :c, :d => 7)).not_to eq(:d => 7)
end
View
2  spec/rspec/mocks/mock_space_spec.rb
@@ -55,4 +55,4 @@ def reset?
end
end
end
-
+
View
4 specs.watchr
@@ -12,7 +12,7 @@ end
def run_test_matching(thing_to_match)
matches = all_test_files.grep(/#{thing_to_match}/i)
if matches.empty?
- puts "Sorry, thanks for playing, but there were no matches for #{thing_to_match}"
+ puts "Sorry, thanks for playing, but there were no matches for #{thing_to_match}"
else
run matches.join(' ')
end
@@ -43,7 +43,7 @@ def no_int_for_you
end
Signal.trap 'INT' do
- if @sent_an_int then
+ if @sent_an_int then
puts " A second INT? Ok, I get the message. Shutting down now."
exit
else
Please sign in to comment.
Something went wrong with that request. Please try again.