Permalink
Browse files

this has been moved to features/argument_matchers

  • Loading branch information...
1 parent 1018eaf commit 3e1bbbae91fdc1c22792ffbb91c106ff2db2402e @dchelimsky dchelimsky committed Oct 9, 2011
Showing with 0 additions and 59 deletions.
  1. +0 −59 features/method_stubs/stub_with_arguments.feature
@@ -1,59 +0,0 @@
-Feature: stub with arguments
-
- Use `with` to constrain stubs to calls with specific arguments. This works
- like a message expectation with `any_number_of_times`: it will cause a
- failure if invoked with a different argument, but it will not cause a failure
- if it is not invoked.
-
- Background:
- Given a file named "account.rb" with:
- """
- class Account
- def initialize(logger)
- @logger = logger
- end
-
- def open
- @logger.log :open
- end
- end
- """
-
- Scenario: method invoked with expected argument
- Given a file named "example_spec.rb" with:
- """
- require "./account.rb"
-
- describe Account do
- it "can open an account" do
- logger = double('logger')
- account = Account.new(logger)
- logger.stub(:log).with(:open)
- account.open
- end
- end
- """
- When I run `rspec example_spec.rb`
- Then the examples should all pass
-
- Scenario: method invoked with a different argument
- Given a file named "example_spec.rb" with:
- """
- require "./account.rb"
-
- describe Account do
- it "can open an account" do
- logger = double('logger')
- account = Account.new(logger)
- logger.stub(:log).with(:open_account)
- account.open
- end
- end
- """
- When I run `rspec example_spec.rb`
- Then the output should contain "1 failure"
- And the output should contain:
- """
- expected: (:open_account)
- got: (:open)
- """

0 comments on commit 3e1bbba

Please sign in to comment.