stirlitz 0.0.1.1 → 0.0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -37,11 +37,20 @@ module Stirlitz
37
37
  end
38
38
 
39
39
  def failure_message_for_should
40
- "#{@actual} should have been called on #{@expected.inspect}"
40
+ if @args
41
+ "#{@expected} should have been called on #{@actual.inspect} with #{@args.inspect}, but #{@actual.received_message?(@expected) ? ' was called with other arguments' : 'wasn\'t'}"
42
+ else
43
+ "#{@expected} should have been called on #{@actual.inspect}. but wasn't"
44
+ end
41
45
  end
42
46
 
43
47
  def failure_message_for_should_not
44
- "#{@actual} should not have been called on #{@expected.inspect}"
48
+ if @args
49
+ "#{@expected} should not have been called on #{@actual.inspect} with #{@args.inspect}, but was"
50
+ else
51
+ "#{@expected} should not have been called on #{@actual.inspect}. but was"
52
+ end
53
+ "#{@expected} should not have been called on #{@actual.inspect}"
45
54
  end
46
55
  end
47
56
  end
@@ -1,5 +1,5 @@
1
1
  module Stirlitz # :nodoc:
2
2
  module Version # :nodoc:
3
- STRING = "0.0.1.1"
3
+ STRING = "0.0.1.2"
4
4
  end
5
5
  end
@@ -16,5 +16,13 @@ module Stirlitz
16
16
  a_spy.a_method(10, 20)
17
17
  a_spy.should have_received(:a_method).with(10, 20)
18
18
  end
19
+
20
+ it "fails when the method is called with different arguments" do
21
+ a_spy = spy
22
+ a_spy.a_method(30)
23
+ lambda do
24
+ a_spy.should have_received(:a_method).with(40)
25
+ end.should raise_error
26
+ end
19
27
  end
20
28
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: stirlitz
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.1.1
5
+ version: 0.0.1.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Srushti Ambekallu
@@ -11,7 +11,7 @@ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
13
 
14
- date: 2011-03-23 00:00:00 +05:30
14
+ date: 2011-03-24 00:00:00 +05:30
15
15
  default_executable:
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
@@ -85,7 +85,7 @@ rubyforge_project: stirlitz
85
85
  rubygems_version: 1.6.2
86
86
  signing_key:
87
87
  specification_version: 3
88
- summary: stirlitz-0.0.1.1
88
+ summary: stirlitz-0.0.1.2
89
89
  test_files:
90
90
  - spec/spec_helper.rb
91
91
  - spec/stirlitz/matchers_spec.rb