features/message_expectations/expect_message.feature in rspec-mocks-2.11.3 vs features/message_expectations/expect_message.feature in rspec-mocks-2.12.0
- old
+ new
@@ -3,11 +3,11 @@
Use should_receive() to set an expectation that a receiver should receive a
message before the example is completed.
Scenario: expect a message
Given a file named "spec/account_spec.rb" with:
- """
+ """ruby
require "account"
describe Account do
context "when closed" do
it "logs an account closed message" do
@@ -21,11 +21,11 @@
end
end
end
"""
And a file named "lib/account.rb" with:
- """
+ """ruby
class Account
attr_accessor :logger
def close
logger.account_closed
@@ -35,11 +35,11 @@
When I run `rspec spec/account_spec.rb`
Then the output should contain "1 example, 0 failures"
Scenario: expect a message with an argument
Given a file named "spec/account_spec.rb" with:
- """
+ """ruby
require "account"
describe Account do
context "when closed" do
it "logs an account closed message" do
@@ -53,11 +53,11 @@
end
end
end
"""
And a file named "lib/account.rb" with:
- """
+ """ruby
class Account
attr_accessor :logger
def close
logger.account_closed(self)
@@ -67,10 +67,10 @@
When I run `rspec spec/account_spec.rb`
Then the output should contain "1 example, 0 failures"
Scenario: provide a return value
Given a file named "message_expectation_spec.rb" with:
- """
+ """ruby
describe "a message expectation" do
context "with a return value" do
context "specified in a block" do
it "returns the specified value" do
receiver = double("receiver")