rspec-mocks 2.13.1 → 2.14.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- data/Changelog.md +45 -4
- data/README.md +1 -1
- data/features/argument_matchers/README.md +2 -2
- data/features/argument_matchers/explicit.feature +2 -3
- data/features/argument_matchers/general_matchers.feature +2 -2
- data/features/argument_matchers/type_matchers.feature +3 -4
- data/features/message_expectations/README.md +2 -2
- data/features/message_expectations/any_instance.feature +2 -2
- data/features/message_expectations/block_local_expectations.feature.pending +3 -3
- data/features/message_expectations/expect_message_using_expect.feature +103 -0
- data/features/message_expectations/expect_message_using_should_receive.feature +118 -0
- data/features/message_expectations/receive_counts.feature +1 -1
- data/features/method_stubs/README.md +1 -1
- data/features/method_stubs/any_instance.feature +11 -11
- data/features/method_stubs/as_null_object.feature +1 -1
- data/features/method_stubs/stub_implementation.feature +2 -2
- data/features/outside_rspec/configuration.feature +0 -20
- data/features/spies/spy_partial_mock_method.feature +34 -0
- data/features/spies/spy_pure_mock_method.feature +76 -0
- data/features/spies/spy_unstubbed_method.feature +18 -0
- data/features/step_definitions/additional_cli_steps.rb +7 -0
- data/features/test_frameworks/test_unit.feature +43 -0
- data/lib/rspec/mocks.rb +9 -34
- data/lib/rspec/mocks/any_instance/chain.rb +8 -2
- data/lib/rspec/mocks/any_instance/expectation_chain.rb +19 -16
- data/lib/rspec/mocks/any_instance/recorder.rb +6 -3
- data/lib/rspec/mocks/any_instance/stub_chain.rb +11 -11
- data/lib/rspec/mocks/any_instance/stub_chain_chain.rb +8 -10
- data/lib/rspec/mocks/argument_list_matcher.rb +7 -3
- data/lib/rspec/mocks/configuration.rb +28 -1
- data/lib/rspec/mocks/deprecation.rb +18 -0
- data/lib/rspec/mocks/error_generator.rb +60 -8
- data/lib/rspec/mocks/errors.rb +1 -1
- data/lib/rspec/mocks/example_methods.rb +39 -3
- data/lib/rspec/mocks/extensions/marshal.rb +4 -10
- data/lib/rspec/mocks/framework.rb +16 -4
- data/lib/rspec/mocks/instance_method_stasher.rb +3 -0
- data/lib/rspec/mocks/matchers/have_received.rb +93 -0
- data/lib/rspec/mocks/matchers/receive.rb +92 -0
- data/lib/rspec/mocks/message_expectation.rb +66 -129
- data/lib/rspec/mocks/method_double.rb +50 -43
- data/lib/rspec/mocks/mutate_const.rb +8 -20
- data/lib/rspec/mocks/proxy.rb +41 -25
- data/lib/rspec/mocks/proxy_for_nil.rb +36 -0
- data/lib/rspec/mocks/space.rb +64 -11
- data/lib/rspec/mocks/stub_chain.rb +51 -0
- data/lib/rspec/mocks/syntax.rb +329 -0
- data/lib/rspec/mocks/targets.rb +69 -0
- data/lib/rspec/mocks/test_double.rb +25 -4
- data/lib/rspec/mocks/version.rb +1 -1
- data/lib/spec/mocks.rb +1 -3
- data/spec/rspec/mocks/and_call_original_spec.rb +8 -0
- data/spec/rspec/mocks/and_yield_spec.rb +6 -6
- data/spec/rspec/mocks/any_instance_spec.rb +43 -31
- data/spec/rspec/mocks/any_number_of_times_spec.rb +6 -0
- data/spec/rspec/mocks/argument_expectation_spec.rb +12 -14
- data/spec/rspec/mocks/at_least_spec.rb +46 -37
- data/spec/rspec/mocks/at_most_spec.rb +12 -12
- data/spec/rspec/mocks/block_return_value_spec.rb +18 -1
- data/spec/rspec/mocks/bug_report_10260_spec.rb +1 -1
- data/spec/rspec/mocks/bug_report_10263_spec.rb +1 -1
- data/spec/rspec/mocks/bug_report_11545_spec.rb +4 -4
- data/spec/rspec/mocks/bug_report_600_spec.rb +1 -1
- data/spec/rspec/mocks/bug_report_7611_spec.rb +1 -1
- data/spec/rspec/mocks/configuration_spec.rb +124 -0
- data/spec/rspec/mocks/double_spec.rb +13 -1
- data/spec/rspec/mocks/failing_argument_matchers_spec.rb +17 -1
- data/spec/rspec/mocks/hash_excluding_matcher_spec.rb +13 -13
- data/spec/rspec/mocks/matchers/have_received_spec.rb +266 -0
- data/spec/rspec/mocks/matchers/receive_spec.rb +318 -0
- data/spec/rspec/mocks/methods_spec.rb +27 -0
- data/spec/rspec/mocks/mock_ordering_spec.rb +4 -4
- data/spec/rspec/mocks/mock_space_spec.rb +94 -39
- data/spec/rspec/mocks/mock_spec.rb +65 -50
- data/spec/rspec/mocks/multiple_return_value_spec.rb +10 -10
- data/spec/rspec/mocks/mutate_const_spec.rb +21 -1
- data/spec/rspec/mocks/nil_expectation_warning_spec.rb +10 -4
- data/spec/rspec/mocks/null_object_mock_spec.rb +11 -2
- data/spec/rspec/mocks/once_counts_spec.rb +5 -5
- data/spec/rspec/mocks/options_hash_spec.rb +4 -4
- data/spec/rspec/mocks/partial_mock_spec.rb +20 -11
- data/spec/rspec/mocks/partial_mock_using_mocks_directly_spec.rb +7 -7
- data/spec/rspec/mocks/passing_argument_matchers_spec.rb +2 -2
- data/spec/rspec/mocks/precise_counts_spec.rb +6 -6
- data/spec/rspec/mocks/serialization_spec.rb +1 -22
- data/spec/rspec/mocks/stash_spec.rb +4 -12
- data/spec/rspec/mocks/stub_implementation_spec.rb +3 -3
- data/spec/rspec/mocks/stub_spec.rb +44 -20
- data/spec/rspec/mocks/stubbed_message_expectations_spec.rb +6 -6
- data/spec/rspec/mocks/twice_counts_spec.rb +6 -6
- data/spec/rspec/mocks_spec.rb +1 -3
- data/spec/spec_helper.rb +25 -1
- metadata +86 -81
- data/features/message_expectations/expect_message.feature +0 -94
- data/lib/rspec/mocks/any_instance.rb +0 -81
- data/lib/rspec/mocks/extensions/psych.rb +0 -23
- data/lib/rspec/mocks/methods.rb +0 -155
- data/lib/rspec/mocks/serialization.rb +0 -34
- data/spec/rspec/mocks/combining_implementation_instructions_spec.rb +0 -197
@@ -2,22 +2,10 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
module RSpec
|
4
4
|
module Mocks
|
5
|
-
describe Serialization do
|
5
|
+
describe "Serialization of mocked objects" do
|
6
6
|
|
7
7
|
class SerializableObject < Struct.new(:foo, :bar); end
|
8
8
|
|
9
|
-
class SerializableMockProxy
|
10
|
-
attr_reader :mock_proxy
|
11
|
-
|
12
|
-
def initialize(mock_proxy)
|
13
|
-
@mock_proxy = mock_proxy
|
14
|
-
end
|
15
|
-
|
16
|
-
def ==(other)
|
17
|
-
other.class == self.class && other.mock_proxy == mock_proxy
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
9
|
def self.with_yaml_loaded(&block)
|
22
10
|
context 'with YAML loaded' do
|
23
11
|
module_eval(&block)
|
@@ -96,15 +84,6 @@ module RSpec
|
|
96
84
|
it 'marshals the same with and without stubbing' do
|
97
85
|
expect { set_stub }.to_not change { Marshal.dump(serializable_object) }
|
98
86
|
end
|
99
|
-
|
100
|
-
describe "an object that has its own mock_proxy instance variable" do
|
101
|
-
let(:serializable_object) { RSpec::Mocks::SerializableMockProxy.new(:my_mock_proxy) }
|
102
|
-
|
103
|
-
it 'does not interfere with its marshalling' do
|
104
|
-
marshalled_copy = Marshal.load(Marshal.dump(serializable_object))
|
105
|
-
expect(marshalled_copy).to eq serializable_object
|
106
|
-
end
|
107
|
-
end
|
108
87
|
end
|
109
88
|
end
|
110
89
|
end
|
@@ -18,22 +18,14 @@ module RSpec
|
|
18
18
|
|
19
19
|
klass.foo(:fizbaz)
|
20
20
|
klass.foo(:bazbar)
|
21
|
-
klass
|
21
|
+
verify klass
|
22
22
|
|
23
|
-
klass
|
23
|
+
reset klass
|
24
24
|
expect(klass.foo(:yeah)).to equal(:original_value)
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
28
|
describe "when a class method is aliased on a subclass and the method is mocked" do
|
29
|
-
let(:klass) do
|
30
|
-
Class.new do
|
31
|
-
class << self
|
32
|
-
alias alternate_new new
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
29
|
it "restores the original aliased public method" do
|
38
30
|
klass = Class.new do
|
39
31
|
class << self
|
@@ -44,9 +36,9 @@ module RSpec
|
|
44
36
|
klass.should_receive(:alternate_new)
|
45
37
|
expect(klass.alternate_new).to be_nil
|
46
38
|
|
47
|
-
klass
|
39
|
+
verify klass
|
48
40
|
|
49
|
-
klass
|
41
|
+
reset klass
|
50
42
|
expect(klass.alternate_new).to be_an_instance_of(klass)
|
51
43
|
end
|
52
44
|
end
|
@@ -5,7 +5,7 @@ module RSpec
|
|
5
5
|
describe "stub implementation" do
|
6
6
|
describe "with no args" do
|
7
7
|
it "execs the block when called" do
|
8
|
-
obj =
|
8
|
+
obj = double()
|
9
9
|
obj.stub(:foo) { :bar }
|
10
10
|
expect(obj.foo).to eq :bar
|
11
11
|
end
|
@@ -13,7 +13,7 @@ module RSpec
|
|
13
13
|
|
14
14
|
describe "with one arg" do
|
15
15
|
it "execs the block with that arg when called" do
|
16
|
-
obj =
|
16
|
+
obj = double()
|
17
17
|
obj.stub(:foo) {|given| given}
|
18
18
|
expect(obj.foo(:bar)).to eq :bar
|
19
19
|
end
|
@@ -21,7 +21,7 @@ module RSpec
|
|
21
21
|
|
22
22
|
describe "with variable args" do
|
23
23
|
it "execs the block when called" do
|
24
|
-
obj =
|
24
|
+
obj = double()
|
25
25
|
obj.stub(:foo) {|*given| given.first}
|
26
26
|
expect(obj.foo(:bar)).to eq :bar
|
27
27
|
end
|
@@ -29,13 +29,37 @@ module RSpec
|
|
29
29
|
@stub = Object.new
|
30
30
|
end
|
31
31
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
32
|
+
describe "using stub" do
|
33
|
+
it "returns declared value when message is received" do
|
34
|
+
@instance.stub(:msg).and_return(:return_value)
|
35
|
+
expect(@instance.msg).to equal(:return_value)
|
36
|
+
verify @instance
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
describe "using stub!" do
|
41
|
+
it "warns of deprecation but still returns the declared value when message is received" do
|
42
|
+
expect(RSpec).to receive(:deprecate).with("stub!", :replacement => "stub")
|
43
|
+
@instance.stub!(:msg).and_return(:return_value)
|
44
|
+
expect(@instance.msg).to equal(:return_value)
|
45
|
+
verify @instance
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
describe 'using unstub' do
|
50
|
+
it 'removes the message stub' do
|
51
|
+
@instance.stub(:msg)
|
52
|
+
@instance.unstub(:msg)
|
53
|
+
expect { @instance.msg }.to raise_error NoMethodError
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
describe 'using unstub!' do
|
58
|
+
it 'removes the message stub but warns about deprecation' do
|
59
|
+
@instance.stub(:msg)
|
60
|
+
RSpec.should_receive(:deprecate).with("unstub!", :replacement => "unstub")
|
61
|
+
@instance.unstub!(:msg)
|
62
|
+
expect { @instance.msg }.to raise_error NoMethodError
|
39
63
|
end
|
40
64
|
end
|
41
65
|
|
@@ -53,7 +77,7 @@ module RSpec
|
|
53
77
|
@instance.stub(:msg)
|
54
78
|
@instance.msg
|
55
79
|
expect do
|
56
|
-
@instance
|
80
|
+
verify @instance
|
57
81
|
end.not_to raise_error
|
58
82
|
end
|
59
83
|
|
@@ -61,14 +85,14 @@ module RSpec
|
|
61
85
|
@instance.stub(:msg)
|
62
86
|
@instance.msg(:an_arg)
|
63
87
|
expect do
|
64
|
-
@instance
|
88
|
+
verify @instance
|
65
89
|
end.not_to raise_error
|
66
90
|
end
|
67
91
|
|
68
92
|
it "ignores when expected message is not received" do
|
69
93
|
@instance.stub(:msg)
|
70
94
|
expect do
|
71
|
-
@instance
|
95
|
+
verify @instance
|
72
96
|
end.not_to raise_error
|
73
97
|
end
|
74
98
|
|
@@ -81,35 +105,35 @@ module RSpec
|
|
81
105
|
describe "#rspec_reset" do
|
82
106
|
it "removes stubbed methods that didn't exist" do
|
83
107
|
@instance.stub(:non_existent_method)
|
84
|
-
@instance
|
108
|
+
reset @instance
|
85
109
|
expect(@instance).not_to respond_to(:non_existent_method)
|
86
110
|
end
|
87
111
|
|
88
112
|
it "restores existing instance methods" do
|
89
113
|
# See bug reports 8302 adn 7805
|
90
114
|
@instance.stub(:existing_instance_method) { :stub_value }
|
91
|
-
@instance
|
115
|
+
reset @instance
|
92
116
|
expect(@instance.existing_instance_method).to eq(:original_value)
|
93
117
|
end
|
94
118
|
|
95
119
|
it "restores existing private instance methods" do
|
96
120
|
# See bug reports 8302 adn 7805
|
97
121
|
@instance.stub(:existing_private_instance_method) { :stub_value }
|
98
|
-
@instance
|
122
|
+
reset @instance
|
99
123
|
expect(@instance.send(:existing_private_instance_method)).to eq(:original_value)
|
100
124
|
end
|
101
125
|
|
102
126
|
it "restores existing class methods" do
|
103
127
|
# See bug reports 8302 adn 7805
|
104
128
|
@class.stub(:existing_class_method) { :stub_value }
|
105
|
-
@class
|
129
|
+
reset @class
|
106
130
|
expect(@class.existing_class_method).to eq(:original_value)
|
107
131
|
end
|
108
132
|
|
109
133
|
it "restores existing private class methods" do
|
110
134
|
# See bug reports 8302 adn 7805
|
111
135
|
@class.stub(:existing_private_class_method) { :stub_value }
|
112
|
-
@class
|
136
|
+
reset @class
|
113
137
|
expect(@class.send(:existing_private_class_method)).to eq(:original_value)
|
114
138
|
end
|
115
139
|
|
@@ -117,7 +141,7 @@ module RSpec
|
|
117
141
|
@instance.stub(:existing_instance_method)
|
118
142
|
@instance.stub(:existing_instance_method)
|
119
143
|
|
120
|
-
@instance
|
144
|
+
reset @instance
|
121
145
|
|
122
146
|
expect(@instance.existing_instance_method).to eq(:original_value)
|
123
147
|
end
|
@@ -136,7 +160,7 @@ module RSpec
|
|
136
160
|
expect(mod.hello).to eq(:hello)
|
137
161
|
|
138
162
|
mod.stub(:hello) { :stub }
|
139
|
-
mod
|
163
|
+
reset mod
|
140
164
|
|
141
165
|
expect(mod.hello).to eq(:hello)
|
142
166
|
end
|
@@ -163,7 +187,7 @@ module RSpec
|
|
163
187
|
current_value = :value_before
|
164
188
|
@instance.method_that_yields {|val| current_value = val}
|
165
189
|
expect(current_value).to eq :yielded_obj
|
166
|
-
@instance
|
190
|
+
verify @instance
|
167
191
|
end
|
168
192
|
|
169
193
|
it "yields multiple times with multiple calls to and_yield" do
|
@@ -172,7 +196,7 @@ module RSpec
|
|
172
196
|
current_value = []
|
173
197
|
@instance.method_that_yields_multiple_times {|val| current_value << val}
|
174
198
|
expect(current_value).to eq [:yielded_value, :another_value]
|
175
|
-
@instance
|
199
|
+
verify @instance
|
176
200
|
end
|
177
201
|
|
178
202
|
it "yields a specified object and return another specified object" do
|
@@ -213,7 +237,7 @@ module RSpec
|
|
213
237
|
it "calculates return value by executing block passed to #and_return" do
|
214
238
|
@stub.stub(:something).with("a","b","c").and_return { |a,b,c| c+b+a }
|
215
239
|
expect(@stub.something("a","b","c")).to eq "cba"
|
216
|
-
@stub
|
240
|
+
verify @stub
|
217
241
|
end
|
218
242
|
end
|
219
243
|
|
@@ -5,7 +5,7 @@ describe "expection set on previously stubbed method" do
|
|
5
5
|
double = double(:msg => nil)
|
6
6
|
double.msg
|
7
7
|
double.should_receive(:msg)
|
8
|
-
expect { double
|
8
|
+
expect { verify double }.to raise_error(RSpec::Mocks::MockExpectationError)
|
9
9
|
end
|
10
10
|
|
11
11
|
it "outputs arguments of similar calls" do
|
@@ -14,9 +14,9 @@ describe "expection set on previously stubbed method" do
|
|
14
14
|
double.foo('second')
|
15
15
|
double.foo('third')
|
16
16
|
expect {
|
17
|
-
double
|
17
|
+
verify double
|
18
18
|
}.to raise_error(%Q|Double "double" received :foo with unexpected arguments\n expected: ("first")\n got: ("second"), ("third")|)
|
19
|
-
double
|
19
|
+
reset double
|
20
20
|
end
|
21
21
|
|
22
22
|
context "with argument constraint on stub" do
|
@@ -25,7 +25,7 @@ describe "expection set on previously stubbed method" do
|
|
25
25
|
double.stub(:foo).with(3).and_return("stub")
|
26
26
|
double.should_receive(:foo).at_least(:once).and_return("expectation")
|
27
27
|
double.foo
|
28
|
-
double
|
28
|
+
verify double
|
29
29
|
end
|
30
30
|
|
31
31
|
it "matches specific args set on expectation" do
|
@@ -33,7 +33,7 @@ describe "expection set on previously stubbed method" do
|
|
33
33
|
double.stub(:foo).with(3).and_return("stub")
|
34
34
|
double.should_receive(:foo).at_least(:once).with(4).and_return("expectation")
|
35
35
|
double.foo(4)
|
36
|
-
double
|
36
|
+
verify double
|
37
37
|
end
|
38
38
|
|
39
39
|
it "fails if expectation's arg constraint is not met" do
|
@@ -41,7 +41,7 @@ describe "expection set on previously stubbed method" do
|
|
41
41
|
double.stub(:foo).with(3).and_return("stub")
|
42
42
|
double.should_receive(:foo).at_least(:once).with(4).and_return("expectation")
|
43
43
|
double.foo(3)
|
44
|
-
expect { double
|
44
|
+
expect { verify double }.to raise_error(/expected: \(4\)\s+got: \(3\)/)
|
45
45
|
end
|
46
46
|
|
47
47
|
it 'distinguishes between individual values and arrays properly' do
|
@@ -11,21 +11,21 @@ module RSpec
|
|
11
11
|
@double.should_receive(:do_something).twice
|
12
12
|
@double.do_something
|
13
13
|
@double.do_something
|
14
|
-
@double
|
14
|
+
verify @double
|
15
15
|
end
|
16
16
|
|
17
17
|
it "passes when called twice with specified args" do
|
18
18
|
@double.should_receive(:do_something).twice.with("1", 1)
|
19
19
|
@double.do_something("1", 1)
|
20
20
|
@double.do_something("1", 1)
|
21
|
-
@double
|
21
|
+
verify @double
|
22
22
|
end
|
23
23
|
|
24
24
|
it "passes when called twice with unspecified args" do
|
25
25
|
@double.should_receive(:do_something).twice
|
26
26
|
@double.do_something("1")
|
27
27
|
@double.do_something(1)
|
28
|
-
@double
|
28
|
+
verify @double
|
29
29
|
end
|
30
30
|
|
31
31
|
it "fails fast when call count is higher than expected" do
|
@@ -41,7 +41,7 @@ module RSpec
|
|
41
41
|
@double.should_receive(:do_something).twice
|
42
42
|
@double.do_something
|
43
43
|
expect {
|
44
|
-
@double
|
44
|
+
verify @double
|
45
45
|
}.to raise_error(RSpec::Mocks::MockExpectationError)
|
46
46
|
end
|
47
47
|
|
@@ -50,7 +50,7 @@ module RSpec
|
|
50
50
|
expect {
|
51
51
|
@double.do_something(1, "1")
|
52
52
|
}.to raise_error(RSpec::Mocks::MockExpectationError)
|
53
|
-
@double
|
53
|
+
reset @double
|
54
54
|
end
|
55
55
|
|
56
56
|
it "fails when called with wrong args on the second call" do
|
@@ -59,7 +59,7 @@ module RSpec
|
|
59
59
|
expect {
|
60
60
|
@double.do_something(1, "1")
|
61
61
|
}.to raise_error(RSpec::Mocks::MockExpectationError)
|
62
|
-
@double
|
62
|
+
reset @double
|
63
63
|
end
|
64
64
|
end
|
65
65
|
end
|
data/spec/rspec/mocks_spec.rb
CHANGED
@@ -58,9 +58,7 @@ describe RSpec::Mocks do
|
|
58
58
|
|
59
59
|
context 'when requiring spec/mocks (as was valid for rspec 1)' do
|
60
60
|
it 'prints a deprecation warning' do
|
61
|
-
::RSpec
|
62
|
-
with(%r|spec/mocks|)
|
63
|
-
|
61
|
+
expect(::RSpec).to receive(:deprecate).with("require 'spec/mocks'", :replacement => "require 'rspec/mocks'")
|
64
62
|
load "spec/mocks.rb"
|
65
63
|
end
|
66
64
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -10,11 +10,20 @@ RSpec::Matchers.define :include_method do |expected|
|
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
|
+
module VerifyAndResetHelpers
|
14
|
+
def verify(object)
|
15
|
+
RSpec::Mocks.proxy_for(object).verify
|
16
|
+
end
|
17
|
+
|
18
|
+
def reset(object)
|
19
|
+
RSpec::Mocks.proxy_for(object).reset
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
13
23
|
RSpec.configure do |config|
|
14
24
|
config.mock_with :rspec
|
15
25
|
config.color_enabled = true
|
16
26
|
config.order = :random
|
17
|
-
config.include(RSpec::Mocks::Methods)
|
18
27
|
config.run_all_when_everything_filtered = true
|
19
28
|
config.treat_symbols_as_metadata_keys_with_true_values = true
|
20
29
|
config.filter_run_including :focus
|
@@ -32,5 +41,20 @@ RSpec.configure do |config|
|
|
32
41
|
config.after(:each, :silence_warnings) do
|
33
42
|
$VERBOSE = old_verbose
|
34
43
|
end
|
44
|
+
|
45
|
+
config.include VerifyAndResetHelpers
|
46
|
+
end
|
47
|
+
|
48
|
+
shared_context "with syntax" do |syntax|
|
49
|
+
orig_syntax = nil
|
50
|
+
|
51
|
+
before(:all) do
|
52
|
+
orig_syntax = RSpec::Mocks.configuration.syntax
|
53
|
+
RSpec::Mocks.configuration.syntax = syntax
|
54
|
+
end
|
55
|
+
|
56
|
+
after(:all) do
|
57
|
+
RSpec::Mocks.configuration.syntax = orig_syntax
|
58
|
+
end
|
35
59
|
end
|
36
60
|
|
metadata
CHANGED
@@ -1,81 +1,72 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-mocks
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
6
|
-
segments:
|
7
|
-
- 2
|
8
|
-
- 13
|
9
|
-
- 1
|
10
|
-
version: 2.13.1
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: 7
|
5
|
+
version: 2.14.0.rc1
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Steven Baker
|
14
9
|
- David Chelimsky
|
15
10
|
autorequire:
|
16
11
|
bindir: bin
|
17
12
|
cert_chain: []
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
none: false
|
24
|
-
requirements:
|
13
|
+
date: 2013-05-27 00:00:00.000000000 Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
version_requirements: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
25
18
|
- - ~>
|
26
|
-
- !ruby/object:Gem::Version
|
27
|
-
hash: 79
|
28
|
-
segments:
|
29
|
-
- 10
|
30
|
-
- 0
|
31
|
-
- 0
|
19
|
+
- !ruby/object:Gem::Version
|
32
20
|
version: 10.0.0
|
21
|
+
none: false
|
33
22
|
prerelease: false
|
34
|
-
type: :development
|
35
23
|
name: rake
|
36
|
-
requirement:
|
37
|
-
|
38
|
-
|
24
|
+
requirement: !ruby/object:Gem::Requirement
|
25
|
+
requirements:
|
26
|
+
- - ~>
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
version: 10.0.0
|
39
29
|
none: false
|
40
|
-
|
30
|
+
type: :development
|
31
|
+
- !ruby/object:Gem::Dependency
|
32
|
+
version_requirements: !ruby/object:Gem::Requirement
|
33
|
+
requirements:
|
41
34
|
- - ~>
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
hash: 1
|
44
|
-
segments:
|
45
|
-
- 1
|
46
|
-
- 1
|
47
|
-
- 9
|
35
|
+
- !ruby/object:Gem::Version
|
48
36
|
version: 1.1.9
|
37
|
+
none: false
|
49
38
|
prerelease: false
|
50
|
-
type: :development
|
51
39
|
name: cucumber
|
52
|
-
requirement:
|
53
|
-
|
54
|
-
|
40
|
+
requirement: !ruby/object:Gem::Requirement
|
41
|
+
requirements:
|
42
|
+
- - ~>
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: 1.1.9
|
55
45
|
none: false
|
56
|
-
|
46
|
+
type: :development
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
version_requirements: !ruby/object:Gem::Requirement
|
49
|
+
requirements:
|
57
50
|
- - ~>
|
58
|
-
- !ruby/object:Gem::Version
|
59
|
-
|
60
|
-
|
61
|
-
- 0
|
62
|
-
- 5
|
63
|
-
version: "0.5"
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: '0.5'
|
53
|
+
none: false
|
64
54
|
prerelease: false
|
65
|
-
type: :development
|
66
55
|
name: aruba
|
67
|
-
requirement:
|
56
|
+
requirement: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - ~>
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '0.5'
|
61
|
+
none: false
|
62
|
+
type: :development
|
68
63
|
description: RSpec's 'test double' framework, with support for stubbing and mocking
|
69
64
|
email: rspec-users@rubyforge.org
|
70
65
|
executables: []
|
71
|
-
|
72
66
|
extensions: []
|
73
|
-
|
74
67
|
extra_rdoc_files: []
|
75
|
-
|
76
|
-
files:
|
68
|
+
files:
|
77
69
|
- lib/rspec/mocks.rb
|
78
|
-
- lib/rspec/mocks/any_instance.rb
|
79
70
|
- lib/rspec/mocks/any_instance/chain.rb
|
80
71
|
- lib/rspec/mocks/any_instance/expectation_chain.rb
|
81
72
|
- lib/rspec/mocks/any_instance/message_chains.rb
|
@@ -85,24 +76,28 @@ files:
|
|
85
76
|
- lib/rspec/mocks/argument_list_matcher.rb
|
86
77
|
- lib/rspec/mocks/argument_matchers.rb
|
87
78
|
- lib/rspec/mocks/configuration.rb
|
79
|
+
- lib/rspec/mocks/deprecation.rb
|
88
80
|
- lib/rspec/mocks/error_generator.rb
|
89
81
|
- lib/rspec/mocks/errors.rb
|
90
82
|
- lib/rspec/mocks/example_methods.rb
|
91
83
|
- lib/rspec/mocks/extensions/instance_exec.rb
|
92
84
|
- lib/rspec/mocks/extensions/marshal.rb
|
93
|
-
- lib/rspec/mocks/extensions/psych.rb
|
94
85
|
- lib/rspec/mocks/framework.rb
|
95
86
|
- lib/rspec/mocks/instance_method_stasher.rb
|
87
|
+
- lib/rspec/mocks/matchers/have_received.rb
|
88
|
+
- lib/rspec/mocks/matchers/receive.rb
|
96
89
|
- lib/rspec/mocks/message_expectation.rb
|
97
90
|
- lib/rspec/mocks/method_double.rb
|
98
|
-
- lib/rspec/mocks/methods.rb
|
99
91
|
- lib/rspec/mocks/mock.rb
|
100
92
|
- lib/rspec/mocks/mutate_const.rb
|
101
93
|
- lib/rspec/mocks/order_group.rb
|
102
94
|
- lib/rspec/mocks/proxy.rb
|
103
|
-
- lib/rspec/mocks/
|
95
|
+
- lib/rspec/mocks/proxy_for_nil.rb
|
104
96
|
- lib/rspec/mocks/space.rb
|
105
97
|
- lib/rspec/mocks/standalone.rb
|
98
|
+
- lib/rspec/mocks/stub_chain.rb
|
99
|
+
- lib/rspec/mocks/syntax.rb
|
100
|
+
- lib/rspec/mocks/targets.rb
|
106
101
|
- lib/rspec/mocks/test_double.rb
|
107
102
|
- lib/rspec/mocks/version.rb
|
108
103
|
- lib/spec/mocks.rb
|
@@ -122,7 +117,8 @@ files:
|
|
122
117
|
- features/message_expectations/any_instance.feature
|
123
118
|
- features/message_expectations/block_local_expectations.feature.pending
|
124
119
|
- features/message_expectations/call_original.feature
|
125
|
-
- features/message_expectations/
|
120
|
+
- features/message_expectations/expect_message_using_expect.feature
|
121
|
+
- features/message_expectations/expect_message_using_should_receive.feature
|
126
122
|
- features/message_expectations/receive_counts.feature
|
127
123
|
- features/message_expectations/warn_when_expectation_is_set_on_nil.feature
|
128
124
|
- features/method_stubs/README.md
|
@@ -138,8 +134,12 @@ files:
|
|
138
134
|
- features/mutating_constants/stub_undefined_constant.feature
|
139
135
|
- features/outside_rspec/configuration.feature
|
140
136
|
- features/outside_rspec/standalone.feature
|
137
|
+
- features/spies/spy_partial_mock_method.feature
|
138
|
+
- features/spies/spy_pure_mock_method.feature
|
139
|
+
- features/spies/spy_unstubbed_method.feature
|
141
140
|
- features/step_definitions/additional_cli_steps.rb
|
142
141
|
- features/support/env.rb
|
142
|
+
- features/test_frameworks/test_unit.feature
|
143
143
|
- spec/rspec/mocks/and_call_original_spec.rb
|
144
144
|
- spec/rspec/mocks/and_yield_spec.rb
|
145
145
|
- spec/rspec/mocks/any_instance/message_chains_spec.rb
|
@@ -158,13 +158,15 @@ files:
|
|
158
158
|
- spec/rspec/mocks/bug_report_8165_spec.rb
|
159
159
|
- spec/rspec/mocks/bug_report_830_spec.rb
|
160
160
|
- spec/rspec/mocks/bug_report_957_spec.rb
|
161
|
-
- spec/rspec/mocks/combining_implementation_instructions_spec.rb
|
162
161
|
- spec/rspec/mocks/configuration_spec.rb
|
163
162
|
- spec/rspec/mocks/double_spec.rb
|
164
163
|
- spec/rspec/mocks/failing_argument_matchers_spec.rb
|
165
164
|
- spec/rspec/mocks/hash_excluding_matcher_spec.rb
|
166
165
|
- spec/rspec/mocks/hash_including_matcher_spec.rb
|
167
166
|
- spec/rspec/mocks/instance_method_stasher_spec.rb
|
167
|
+
- spec/rspec/mocks/matchers/have_received_spec.rb
|
168
|
+
- spec/rspec/mocks/matchers/receive_spec.rb
|
169
|
+
- spec/rspec/mocks/methods_spec.rb
|
168
170
|
- spec/rspec/mocks/mock_ordering_spec.rb
|
169
171
|
- spec/rspec/mocks/mock_space_spec.rb
|
170
172
|
- spec/rspec/mocks/mock_spec.rb
|
@@ -191,39 +193,35 @@ files:
|
|
191
193
|
- spec/rspec/mocks_spec.rb
|
192
194
|
- spec/spec_helper.rb
|
193
195
|
homepage: http://github.com/rspec/rspec-mocks
|
194
|
-
licenses:
|
196
|
+
licenses:
|
195
197
|
- MIT
|
196
198
|
post_install_message:
|
197
|
-
rdoc_options:
|
199
|
+
rdoc_options:
|
198
200
|
- --charset=UTF-8
|
199
|
-
require_paths:
|
201
|
+
require_paths:
|
200
202
|
- lib
|
201
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
segments:
|
203
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
204
|
+
requirements:
|
205
|
+
- - ! '>='
|
206
|
+
- !ruby/object:Gem::Version
|
207
|
+
version: '0'
|
208
|
+
segments:
|
208
209
|
- 0
|
209
|
-
|
210
|
-
|
210
|
+
hash: 1552323332526866969
|
211
|
+
none: false
|
212
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
213
|
+
requirements:
|
214
|
+
- - ! '>'
|
215
|
+
- !ruby/object:Gem::Version
|
216
|
+
version: 1.3.1
|
211
217
|
none: false
|
212
|
-
requirements:
|
213
|
-
- - ">="
|
214
|
-
- !ruby/object:Gem::Version
|
215
|
-
hash: 3
|
216
|
-
segments:
|
217
|
-
- 0
|
218
|
-
version: "0"
|
219
218
|
requirements: []
|
220
|
-
|
221
219
|
rubyforge_project: rspec
|
222
220
|
rubygems_version: 1.8.24
|
223
221
|
signing_key:
|
224
222
|
specification_version: 3
|
225
|
-
summary: rspec-mocks-2.
|
226
|
-
test_files:
|
223
|
+
summary: rspec-mocks-2.14.0.rc1
|
224
|
+
test_files:
|
227
225
|
- features/README.md
|
228
226
|
- features/Scope.md
|
229
227
|
- features/Upgrade.md
|
@@ -235,7 +233,8 @@ test_files:
|
|
235
233
|
- features/message_expectations/any_instance.feature
|
236
234
|
- features/message_expectations/block_local_expectations.feature.pending
|
237
235
|
- features/message_expectations/call_original.feature
|
238
|
-
- features/message_expectations/
|
236
|
+
- features/message_expectations/expect_message_using_expect.feature
|
237
|
+
- features/message_expectations/expect_message_using_should_receive.feature
|
239
238
|
- features/message_expectations/receive_counts.feature
|
240
239
|
- features/message_expectations/warn_when_expectation_is_set_on_nil.feature
|
241
240
|
- features/method_stubs/README.md
|
@@ -251,8 +250,12 @@ test_files:
|
|
251
250
|
- features/mutating_constants/stub_undefined_constant.feature
|
252
251
|
- features/outside_rspec/configuration.feature
|
253
252
|
- features/outside_rspec/standalone.feature
|
253
|
+
- features/spies/spy_partial_mock_method.feature
|
254
|
+
- features/spies/spy_pure_mock_method.feature
|
255
|
+
- features/spies/spy_unstubbed_method.feature
|
254
256
|
- features/step_definitions/additional_cli_steps.rb
|
255
257
|
- features/support/env.rb
|
258
|
+
- features/test_frameworks/test_unit.feature
|
256
259
|
- spec/rspec/mocks/and_call_original_spec.rb
|
257
260
|
- spec/rspec/mocks/and_yield_spec.rb
|
258
261
|
- spec/rspec/mocks/any_instance/message_chains_spec.rb
|
@@ -271,13 +274,15 @@ test_files:
|
|
271
274
|
- spec/rspec/mocks/bug_report_8165_spec.rb
|
272
275
|
- spec/rspec/mocks/bug_report_830_spec.rb
|
273
276
|
- spec/rspec/mocks/bug_report_957_spec.rb
|
274
|
-
- spec/rspec/mocks/combining_implementation_instructions_spec.rb
|
275
277
|
- spec/rspec/mocks/configuration_spec.rb
|
276
278
|
- spec/rspec/mocks/double_spec.rb
|
277
279
|
- spec/rspec/mocks/failing_argument_matchers_spec.rb
|
278
280
|
- spec/rspec/mocks/hash_excluding_matcher_spec.rb
|
279
281
|
- spec/rspec/mocks/hash_including_matcher_spec.rb
|
280
282
|
- spec/rspec/mocks/instance_method_stasher_spec.rb
|
283
|
+
- spec/rspec/mocks/matchers/have_received_spec.rb
|
284
|
+
- spec/rspec/mocks/matchers/receive_spec.rb
|
285
|
+
- spec/rspec/mocks/methods_spec.rb
|
281
286
|
- spec/rspec/mocks/mock_ordering_spec.rb
|
282
287
|
- spec/rspec/mocks/mock_space_spec.rb
|
283
288
|
- spec/rspec/mocks/mock_spec.rb
|