rspec-mocks 2.7.0 → 2.8.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rspec/mocks/any_instance/recorder.rb +0 -1
- data/lib/rspec/mocks/argument_matchers.rb +2 -2
- data/lib/rspec/mocks/version.rb +1 -1
- data/spec/rspec/mocks/any_instance/message_chains_spec.rb +1 -1
- data/spec/rspec/mocks/mock_space_spec.rb +1 -1
- data/spec/rspec/mocks/multiple_return_value_spec.rb +0 -3
- data/spec/rspec/mocks/nil_expectation_warning_spec.rb +1 -1
- data/spec/rspec/mocks/serialization_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -0
- metadata +14 -10
@@ -156,7 +156,6 @@ module RSpec
|
|
156
156
|
@klass.class_eval(<<-EOM, __FILE__, __LINE__)
|
157
157
|
def #{method_name}(*args, &blk)
|
158
158
|
method_name = :#{method_name}
|
159
|
-
current_instance = self
|
160
159
|
invoked_instance = self.class.__recorder.instance_that_received(method_name)
|
161
160
|
raise RSpec::Mocks::MockExpectationError, "The message '#{method_name}' was received by \#{self.inspect} but has already been received by \#{invoked_instance}"
|
162
161
|
end
|
@@ -60,7 +60,7 @@ module RSpec
|
|
60
60
|
return false unless actual.has_key?(key) && value == actual[key]
|
61
61
|
end
|
62
62
|
true
|
63
|
-
rescue NoMethodError
|
63
|
+
rescue NoMethodError
|
64
64
|
return false
|
65
65
|
end
|
66
66
|
|
@@ -79,7 +79,7 @@ module RSpec
|
|
79
79
|
return false if actual.has_key?(key) && value == actual[key]
|
80
80
|
end
|
81
81
|
true
|
82
|
-
rescue NoMethodError
|
82
|
+
rescue NoMethodError
|
83
83
|
return false
|
84
84
|
end
|
85
85
|
|
data/lib/rspec/mocks/version.rb
CHANGED
@@ -19,7 +19,7 @@ describe RSpec::Mocks::AnyInstance::MessageChains do
|
|
19
19
|
it "can remove all stub chains" do
|
20
20
|
chains.add(:method_name, stub_chain)
|
21
21
|
chains.add(:method_name, expectation_chain)
|
22
|
-
chains.add(:method_name,
|
22
|
+
chains.add(:method_name, RSpec::Mocks::AnyInstance::StubChain.new)
|
23
23
|
|
24
24
|
chains.remove_stub_chains_for!(:method_name)
|
25
25
|
chains[:method_name].should eq([expectation_chain])
|
@@ -61,7 +61,6 @@ module RSpec
|
|
61
61
|
end
|
62
62
|
|
63
63
|
it "complains when there are too few calls" do
|
64
|
-
third = Object.new
|
65
64
|
@mock.message.should eq @return_values[0]
|
66
65
|
@mock.message.should eq @return_values[1]
|
67
66
|
expect { @mock.rspec_verify }.to raise_error(
|
@@ -71,7 +70,6 @@ module RSpec
|
|
71
70
|
end
|
72
71
|
|
73
72
|
it "complains when there are too many calls" do
|
74
|
-
third = Object.new
|
75
73
|
@mock.message.should eq @return_values[0]
|
76
74
|
@mock.message.should eq @return_values[1]
|
77
75
|
@mock.message.should eq @return_values[2]
|
@@ -83,7 +81,6 @@ module RSpec
|
|
83
81
|
end
|
84
82
|
|
85
83
|
it "complains when there are too many calls and method is stubbed too" do
|
86
|
-
third = Object.new
|
87
84
|
@mock.stub(:message).and_return :stub_result
|
88
85
|
@mock.message.should eq @return_values[0]
|
89
86
|
@mock.message.should eq @return_values[1]
|
@@ -5,7 +5,7 @@ def remove_last_describe_from_world
|
|
5
5
|
end
|
6
6
|
|
7
7
|
def empty_example_group
|
8
|
-
|
8
|
+
RSpec::Core::ExampleGroup.describe(Object, 'Empty Behaviour Group') { }
|
9
9
|
remove_last_describe_from_world
|
10
10
|
end
|
11
11
|
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-mocks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 15424215
|
5
|
+
prerelease: 6
|
6
6
|
segments:
|
7
7
|
- 2
|
8
|
-
-
|
8
|
+
- 8
|
9
9
|
- 0
|
10
|
-
|
10
|
+
- rc
|
11
|
+
- 1
|
12
|
+
version: 2.8.0.rc1
|
11
13
|
platform: ruby
|
12
14
|
authors:
|
13
15
|
- David Chelimsky
|
@@ -16,7 +18,7 @@ autorequire:
|
|
16
18
|
bindir: bin
|
17
19
|
cert_chain: []
|
18
20
|
|
19
|
-
date: 2011-
|
21
|
+
date: 2011-11-06 00:00:00 Z
|
20
22
|
dependencies: []
|
21
23
|
|
22
24
|
description: RSpec's 'test double' framework, with support for stubbing and mocking
|
@@ -145,19 +147,21 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
145
147
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
146
148
|
none: false
|
147
149
|
requirements:
|
148
|
-
- - "
|
150
|
+
- - ">"
|
149
151
|
- !ruby/object:Gem::Version
|
150
|
-
hash:
|
152
|
+
hash: 25
|
151
153
|
segments:
|
152
|
-
-
|
153
|
-
|
154
|
+
- 1
|
155
|
+
- 3
|
156
|
+
- 1
|
157
|
+
version: 1.3.1
|
154
158
|
requirements: []
|
155
159
|
|
156
160
|
rubyforge_project: rspec
|
157
161
|
rubygems_version: 1.8.11
|
158
162
|
signing_key:
|
159
163
|
specification_version: 3
|
160
|
-
summary: rspec-mocks-2.
|
164
|
+
summary: rspec-mocks-2.8.0.rc1
|
161
165
|
test_files:
|
162
166
|
- features/README.markdown
|
163
167
|
- features/Scope.md
|