aboutsummaryrefslogtreecommitdiffstats
path: root/lib/oauth.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/oauth.c')
0 files changed, 0 insertions, 0 deletions
7.0.5'>hotfix/0.17.0.5 Unnamed repository; edit this file 'description' to name the repository.MimesBrønn
aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/plugins/rspec/examples/failing/mocking_example.rb
blob: 9c735e00b21fc9e9cd3122a0fbdc61fe9411a7e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
describe "Mocker" do

  it "should be able to call mock()" do
    mock = mock("poke me")
    mock.should_receive(:poke)
    mock.poke
  end

  it "should fail when expected message not received" do
    mock = mock("poke me")
    mock.should_receive(:poke)
  end
  
  it "should fail when messages are received out of order" do
    mock = mock("one two three")
    mock.should_receive(:one).ordered
    mock.should_receive(:two).ordered
    mock.should_receive(:three).ordered
    mock.one
    mock.three
    mock.two
  end

  it "should get yelled at when sending unexpected messages" do
    mock = mock("don't talk to me")
    mock.should_not_receive(:any_message_at_all)
    mock.any_message_at_all
  end

  it "has a bug we need to fix" do
    pending "here is the bug" do
      # Actually, no. It's fixed. This will fail because it passes :-)
      mock = mock("Bug")
      mock.should_receive(:hello)
      mock.hello
    end
  end
end