Upgraded Rails and RSpec
[monkeycharger.git] / vendor / plugins / rspec / failing_examples / mocking_example.rb
blob882fc5c0a3eabe3899b7c06f32964129ffee6f32
1 require File.dirname(__FILE__) + '/spec_helper'
3 describe "Mocker" do
5   it "should be able to call mock()" do
6     mock = mock("poke me")
7     mock.should_receive(:poke)
8     mock.poke
9   end
11   it "should fail when expected message not received" do
12     mock = mock("poke me")
13     mock.should_receive(:poke)
14   end
15   
16   it "should fail when messages are received out of order" do
17     mock = mock("one two three")
18     mock.should_receive(:one).ordered
19     mock.should_receive(:two).ordered
20     mock.should_receive(:three).ordered
21     mock.one
22     mock.three
23     mock.two
24   end
26   it "should get yelled at when sending unexpected messages" do
27     mock = mock("don't talk to me")
28     mock.should_not_receive(:any_message_at_all)
29     mock.any_message_at_all
30   end
32   it "should mage eggs and bacon"
33 end