changelog shortlog tags changeset manifest revisions annotate raw

vendor/plugins/rspec/spec/spec/mocks/bug_report_10263.rb

changeset 15: 64acf98d15f4
author: moriq@moriq.com
date: Mon Mar 10 10:12:58 2008 +0900 (16 years ago)
permissions: -rw-r--r--
description: add plugins rspec
1describe "Mock" do
2 before do
3 @mock = mock("test mock")
4 end
5
6 specify "when one example has an expectation (non-mock) inside the block passed to the mock" do
7 @mock.should_receive(:msg) do |b|
8 b.should be_true #this call exposes the problem
9 end
10 @mock.msg(false) rescue nil
11 end
12
13 specify "then the next example should behave as expected instead of saying" do
14 @mock.should_receive(:foobar)
15 @mock.foobar
16 @mock.rspec_verify
17 begin
18 @mock.foobar
19 rescue Exception => e
20 e.message.should == "Mock 'test mock' received unexpected message :foobar with (no args)"
21 end
22 end
23end
24