mspec 1.7.0 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +9 -7
- data/lib/mspec/commands/mspec.rb +0 -8
- data/lib/mspec/guards/platform.rb +4 -0
- data/lib/mspec/helpers/environment.rb +12 -22
- data/lib/mspec/helpers/io.rb +6 -1
- data/lib/mspec/helpers/mock_to_path.rb +1 -1
- data/lib/mspec/helpers/ruby_exe.rb +8 -3
- data/lib/mspec/runner/actions.rb +0 -1
- data/lib/mspec/utils/options.rb +0 -4
- data/lib/mspec/utils/script.rb +0 -1
- data/lib/mspec/version.rb +1 -1
- data/spec/commands/mkspec_spec.rb +31 -31
- data/spec/commands/mspec_ci_spec.rb +14 -14
- data/spec/commands/mspec_run_spec.rb +4 -4
- data/spec/commands/mspec_spec.rb +33 -56
- data/spec/commands/mspec_tag_spec.rb +26 -26
- data/spec/guards/background_spec.rb +1 -1
- data/spec/guards/block_device_spec.rb +1 -1
- data/spec/guards/bug_spec.rb +4 -4
- data/spec/guards/compliance_spec.rb +2 -2
- data/spec/guards/conflict_spec.rb +5 -5
- data/spec/guards/endian_spec.rb +8 -8
- data/spec/guards/extensions_spec.rb +1 -1
- data/spec/guards/feature_spec.rb +1 -1
- data/spec/guards/guard_spec.rb +20 -20
- data/spec/guards/noncompliance_spec.rb +1 -1
- data/spec/guards/platform_spec.rb +14 -14
- data/spec/guards/quarantine_spec.rb +1 -1
- data/spec/guards/runner_spec.rb +7 -7
- data/spec/guards/specified_spec.rb +7 -7
- data/spec/guards/superuser_spec.rb +3 -3
- data/spec/guards/support_spec.rb +1 -1
- data/spec/guards/tty_spec.rb +1 -1
- data/spec/guards/user_spec.rb +3 -3
- data/spec/guards/version_spec.rb +3 -3
- data/spec/helpers/ducktype_spec.rb +3 -3
- data/spec/helpers/environment_spec.rb +18 -10
- data/spec/helpers/flunk_spec.rb +2 -2
- data/spec/helpers/io_spec.rb +2 -2
- data/spec/helpers/ruby_exe_spec.rb +5 -9
- data/spec/matchers/have_singleton_method_spec.rb +1 -1
- data/spec/matchers/output_spec.rb +1 -1
- data/spec/mocks/mock_spec.rb +41 -41
- data/spec/mocks/proxy_spec.rb +1 -1
- data/spec/runner/actions/filter_spec.rb +1 -1
- data/spec/runner/actions/tag_spec.rb +17 -17
- data/spec/runner/actions/taglist_spec.rb +8 -8
- data/spec/runner/actions/tagpurge_spec.rb +11 -11
- data/spec/runner/actions/timer_spec.rb +4 -4
- data/spec/runner/context_spec.rb +32 -32
- data/spec/runner/example_spec.rb +1 -1
- data/spec/runner/filters/profile_spec.rb +2 -2
- data/spec/runner/filters/tag_spec.rb +6 -6
- data/spec/runner/formatters/describe_spec.rb +6 -6
- data/spec/runner/formatters/dotted_spec.rb +10 -10
- data/spec/runner/formatters/file_spec.rb +2 -2
- data/spec/runner/formatters/html_spec.rb +10 -10
- data/spec/runner/formatters/junit_spec.rb +11 -11
- data/spec/runner/formatters/method_spec.rb +3 -3
- data/spec/runner/formatters/specdoc_spec.rb +1 -1
- data/spec/runner/formatters/spinner_spec.rb +4 -4
- data/spec/runner/formatters/unit_spec.rb +7 -7
- data/spec/runner/formatters/yaml_spec.rb +10 -10
- data/spec/runner/mspec_spec.rb +25 -25
- data/spec/runner/shared_spec.rb +1 -1
- data/spec/utils/options_spec.rb +28 -50
- data/spec/utils/script_spec.rb +15 -24
- metadata +12 -16
- data/lib/mspec/runner/actions/gdb.rb +0 -17
- data/spec/runner/actions/gdb_spec.rb +0 -61
data/spec/guards/tty_spec.rb
CHANGED
data/spec/guards/user_spec.rb
CHANGED
@@ -4,18 +4,18 @@ require 'mspec/guards'
|
|
4
4
|
describe Object, "#as_user" do
|
5
5
|
before :each do
|
6
6
|
@guard = UserGuard.new
|
7
|
-
UserGuard.stub
|
7
|
+
UserGuard.stub(:new).and_return(@guard)
|
8
8
|
ScratchPad.clear
|
9
9
|
end
|
10
10
|
|
11
11
|
it "yields when the Process.euid is not 0" do
|
12
|
-
Process.stub
|
12
|
+
Process.stub(:euid).and_return(501)
|
13
13
|
as_user { ScratchPad.record :yield }
|
14
14
|
ScratchPad.recorded.should == :yield
|
15
15
|
end
|
16
16
|
|
17
17
|
it "does not yield when the Process.euid is 0" do
|
18
|
-
Process.stub
|
18
|
+
Process.stub(:euid).and_return(0)
|
19
19
|
as_user { ScratchPad.record :yield }
|
20
20
|
ScratchPad.recorded.should_not == :yield
|
21
21
|
end
|
data/spec/guards/version_spec.rb
CHANGED
@@ -99,18 +99,18 @@ end
|
|
99
99
|
describe Object, "#ruby_version_is" do
|
100
100
|
before :each do
|
101
101
|
@guard = VersionGuard.new 'x.x.x.x'
|
102
|
-
VersionGuard.stub
|
102
|
+
VersionGuard.stub(:new).and_return(@guard)
|
103
103
|
ScratchPad.clear
|
104
104
|
end
|
105
105
|
|
106
106
|
it "yields when #match? returns true" do
|
107
|
-
@guard.stub
|
107
|
+
@guard.stub(:match?).and_return(true)
|
108
108
|
ruby_version_is('x.x.x.x') { ScratchPad.record :yield }
|
109
109
|
ScratchPad.recorded.should == :yield
|
110
110
|
end
|
111
111
|
|
112
112
|
it "does not yield when #match? returns false" do
|
113
|
-
@guard.stub
|
113
|
+
@guard.stub(:match?).and_return(false)
|
114
114
|
ruby_version_is('x.x.x.x') { ScratchPad.record :yield }
|
115
115
|
ScratchPad.recorded.should_not == :yield
|
116
116
|
end
|
@@ -4,7 +4,7 @@ require 'mspec/helpers'
|
|
4
4
|
|
5
5
|
describe Object, "#responds_to" do
|
6
6
|
it "returns true for specified symbols" do
|
7
|
-
obj =
|
7
|
+
obj = double("obj")
|
8
8
|
obj.responds_to(:to_flo)
|
9
9
|
obj.should respond_to(:to_flo)
|
10
10
|
obj.should respond_to(:to_s)
|
@@ -13,7 +13,7 @@ end
|
|
13
13
|
|
14
14
|
describe Object, "#does_not_respond_to" do
|
15
15
|
it "returns false for specified symbols" do
|
16
|
-
obj =
|
16
|
+
obj = double("obj")
|
17
17
|
obj.does_not_respond_to(:to_s)
|
18
18
|
obj.should_not respond_to(:to_s)
|
19
19
|
end
|
@@ -30,7 +30,7 @@ end
|
|
30
30
|
|
31
31
|
describe Object, "#fake!" do
|
32
32
|
before :each do
|
33
|
-
@obj =
|
33
|
+
@obj = double("obj")
|
34
34
|
end
|
35
35
|
|
36
36
|
it "makes the object respond to the message" do
|
@@ -8,23 +8,27 @@ describe "#env" do
|
|
8
8
|
end
|
9
9
|
|
10
10
|
it "calls `env` on non-Windows" do
|
11
|
-
PlatformGuard.stub
|
11
|
+
PlatformGuard.stub(:windows?).and_return(false)
|
12
|
+
PlatformGuard.stub(:opal?).and_return(false)
|
12
13
|
should_receive(:`).with("env").and_return("one=two\nthree=four")
|
13
14
|
env
|
14
15
|
end
|
15
16
|
|
16
17
|
it "calls `cmd.exe /C set` on Windows" do
|
17
|
-
PlatformGuard.stub
|
18
|
+
PlatformGuard.stub(:windows?).and_return(true)
|
18
19
|
should_receive(:`).with("cmd.exe /C set").and_return("one=two\nthree=four")
|
19
20
|
env
|
20
21
|
end
|
21
22
|
|
22
|
-
it "returns the current user's environment variables" do
|
23
|
-
PlatformGuard.stub
|
23
|
+
it "returns the current user's environment variables on non-Windows, non-Opal platforms" do
|
24
|
+
PlatformGuard.stub(:windows?).and_return(false)
|
25
|
+
PlatformGuard.stub(:opal?).and_return(false)
|
24
26
|
should_receive(:`).with("env").and_return("one=two\nthree=four")
|
25
27
|
env.should == {"one" => "two", "three" => "four"}
|
28
|
+
end
|
26
29
|
|
27
|
-
|
30
|
+
it "returns the current user's environment variables on Windows" do
|
31
|
+
PlatformGuard.stub(:windows?).and_return(true)
|
28
32
|
should_receive(:`).with("cmd.exe /C set").and_return("five=six\nseven=eight")
|
29
33
|
env.should == {"five" => "six", "seven" => "eight"}
|
30
34
|
end
|
@@ -40,23 +44,27 @@ describe "#username" do
|
|
40
44
|
end
|
41
45
|
|
42
46
|
it "calls `cmd.exe /C ECHO %USERNAME%` on Windows" do
|
43
|
-
PlatformGuard.stub
|
47
|
+
PlatformGuard.stub(:windows?).and_return(true)
|
44
48
|
should_receive(:`).with("cmd.exe /C ECHO %USERNAME%").and_return("john")
|
45
49
|
username
|
46
50
|
end
|
47
51
|
|
48
52
|
it "calls `env` on non-Windows" do
|
49
|
-
PlatformGuard.stub
|
53
|
+
PlatformGuard.stub(:windows?).and_return(false)
|
54
|
+
PlatformGuard.stub(:opal?).and_return(false)
|
50
55
|
should_receive(:`).with("whoami").and_return("john")
|
51
56
|
username
|
52
57
|
end
|
53
58
|
|
54
|
-
it "returns the user's username" do
|
55
|
-
PlatformGuard.stub
|
59
|
+
it "returns the user's username on Windows" do
|
60
|
+
PlatformGuard.stub(:windows?).and_return(true)
|
56
61
|
should_receive(:`).with("cmd.exe /C ECHO %USERNAME%").and_return("johnonwin")
|
57
62
|
username.should == "johnonwin"
|
63
|
+
end
|
58
64
|
|
59
|
-
|
65
|
+
it "returns the user's username on non-Windows, non-Opal platforms" do
|
66
|
+
PlatformGuard.stub(:windows?).and_return(false)
|
67
|
+
PlatformGuard.stub(:opal?).and_return(false)
|
60
68
|
should_receive(:`).with("whoami").and_return("john")
|
61
69
|
username.should == "john"
|
62
70
|
end
|
data/spec/helpers/flunk_spec.rb
CHANGED
@@ -6,8 +6,8 @@ require 'mspec/helpers'
|
|
6
6
|
|
7
7
|
describe Object, "#flunk" do
|
8
8
|
before :each do
|
9
|
-
MSpec.stub
|
10
|
-
MSpec.stub
|
9
|
+
MSpec.stub(:actions)
|
10
|
+
MSpec.stub(:current).and_return(double("spec state").as_null_object)
|
11
11
|
end
|
12
12
|
|
13
13
|
it "raises an SpecExpectationNotMetError unconditionally" do
|
data/spec/helpers/io_spec.rb
CHANGED
@@ -71,7 +71,7 @@ describe Object, "#new_fd" do
|
|
71
71
|
end
|
72
72
|
|
73
73
|
it "accepts an options Hash" do
|
74
|
-
FeatureGuard.stub
|
74
|
+
FeatureGuard.stub(:enabled?).and_return(true)
|
75
75
|
fd = new_fd @name, { :mode => 'w:utf-8' }
|
76
76
|
fd.should be_an_instance_of(Fixnum)
|
77
77
|
|
@@ -83,7 +83,7 @@ describe Object, "#new_fd" do
|
|
83
83
|
end
|
84
84
|
|
85
85
|
it "raises an ArgumentError if the options Hash does not include :mode" do
|
86
|
-
FeatureGuard.stub
|
86
|
+
FeatureGuard.stub(:enabled?).and_return(true)
|
87
87
|
lambda { new_fd @name, { :encoding => "utf-8" } }.should raise_error(ArgumentError)
|
88
88
|
end
|
89
89
|
end
|
@@ -106,7 +106,7 @@ describe "#resolve_ruby_exe" do
|
|
106
106
|
end
|
107
107
|
|
108
108
|
it "returns the value returned by #ruby_exe_options if it exists and is executable" do
|
109
|
-
PlatformGuard.stub
|
109
|
+
PlatformGuard.stub(:windows?).and_return(false)
|
110
110
|
@script.should_receive(:ruby_exe_options).and_return(@name)
|
111
111
|
File.should_receive(:exist?).with(@name).and_return(true)
|
112
112
|
File.should_receive(:executable?).with(@name).and_return(true)
|
@@ -115,7 +115,7 @@ describe "#resolve_ruby_exe" do
|
|
115
115
|
end
|
116
116
|
|
117
117
|
it "returns the value returned by #ruby_exe_options if it exists on Windows platforms" do
|
118
|
-
PlatformGuard.stub
|
118
|
+
PlatformGuard.stub(:windows?).and_return(true)
|
119
119
|
@script.should_receive(:ruby_exe_options).and_return(@name)
|
120
120
|
File.should_receive(:exist?).with(@name).and_return(true)
|
121
121
|
File.should_not_receive(:executable?)
|
@@ -124,7 +124,7 @@ describe "#resolve_ruby_exe" do
|
|
124
124
|
end
|
125
125
|
|
126
126
|
it "expands the path portion of the result of #ruby_exe_options" do
|
127
|
-
PlatformGuard.stub
|
127
|
+
PlatformGuard.stub(:windows?).and_return(false)
|
128
128
|
@script.should_receive(:ruby_exe_options).and_return("#{@name} -Xfoo")
|
129
129
|
File.should_receive(:exist?).with(@name).and_return(true)
|
130
130
|
File.should_receive(:executable?).with(@name).and_return(true)
|
@@ -172,11 +172,6 @@ describe Object, "#ruby_cmd" do
|
|
172
172
|
"ruby_spec_exe -w -Q -w -Cdir some/ruby/file.rb < file.txt"
|
173
173
|
end
|
174
174
|
|
175
|
-
it "returns a command that runs code using -e" do
|
176
|
-
File.should_receive(:exist?).with(@code).and_return(false)
|
177
|
-
@script.ruby_cmd(@code).should == %(ruby_spec_exe -w -Q -e "some \\"real\\" 'ruby' code")
|
178
|
-
end
|
179
|
-
|
180
175
|
it "includes the given options and arguments with -e" do
|
181
176
|
File.should_receive(:exist?).with(@code).and_return(false)
|
182
177
|
@script.ruby_cmd(@code, :options => "-W0 -Cdir", :args => "< file.txt").should ==
|
@@ -195,7 +190,7 @@ describe Object, "#ruby_exe" do
|
|
195
190
|
end
|
196
191
|
|
197
192
|
before :each do
|
198
|
-
@script.stub
|
193
|
+
@script.stub(:`)
|
199
194
|
end
|
200
195
|
|
201
196
|
it "executes (using `) the result of calling #ruby_cmd with the given arguments" do
|
@@ -216,6 +211,7 @@ describe Object, "#ruby_exe" do
|
|
216
211
|
describe "with :env option" do
|
217
212
|
it "preserves the values of existing ENV keys" do
|
218
213
|
ENV["ABC"] = "123"
|
214
|
+
ENV.stub(:[])
|
219
215
|
ENV.should_receive(:[]).with("RUBY_FLAGS")
|
220
216
|
ENV.should_receive(:[]).with("ABC")
|
221
217
|
@script.ruby_exe nil, :env => { :ABC => "xyz" }
|
@@ -18,7 +18,7 @@ describe HaveSingletonMethodMatcher do
|
|
18
18
|
end
|
19
19
|
|
20
20
|
it "matches when the object has a singleton method" do
|
21
|
-
obj =
|
21
|
+
obj = double("HSMMSpecs")
|
22
22
|
def obj.singleton_method; end
|
23
23
|
|
24
24
|
matcher = HaveSingletonMethodMatcher.new :singleton_method
|
@@ -20,7 +20,7 @@ describe OutputMatcher do
|
|
20
20
|
end
|
21
21
|
|
22
22
|
it "provides a useful failure message" do
|
23
|
-
proc = Proc.new {
|
23
|
+
proc = Proc.new { print "unexpected"; $stderr.print "unerror" }
|
24
24
|
matcher = OutputMatcher.new("expected", "error")
|
25
25
|
matcher.matches?(proc)
|
26
26
|
matcher.failure_message.should ==
|
data/spec/mocks/mock_spec.rb
CHANGED
@@ -21,25 +21,25 @@ end
|
|
21
21
|
|
22
22
|
describe Mock, ".replaced_name" do
|
23
23
|
it "returns the name for a method that is being replaced by a mock method" do
|
24
|
-
m =
|
25
|
-
m.stub
|
24
|
+
m = double('a fake id')
|
25
|
+
m.stub(:__mspec_object_id__).and_return(42)
|
26
26
|
Mock.replaced_name(m, :method_call).should == :__mspec_42_method_call__
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
30
|
describe Mock, ".replaced_key" do
|
31
31
|
it "returns a key used internally by Mock" do
|
32
|
-
m =
|
33
|
-
m.stub
|
32
|
+
m = double('a fake id')
|
33
|
+
m.stub(:__mspec_object_id__).and_return(42)
|
34
34
|
Mock.replaced_key(m, :method_call).should == [:__mspec_42_method_call__, :method_call]
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
38
38
|
describe Mock, ".replaced?" do
|
39
39
|
before :each do
|
40
|
-
@mock =
|
41
|
-
MSpec.stub
|
42
|
-
MSpec.stub
|
40
|
+
@mock = double('install_method')
|
41
|
+
MSpec.stub(:actions)
|
42
|
+
MSpec.stub(:current).and_return(double("spec state").as_null_object)
|
43
43
|
end
|
44
44
|
|
45
45
|
it "returns true if a method has been stubbed on an object" do
|
@@ -59,7 +59,7 @@ end
|
|
59
59
|
|
60
60
|
describe Mock, ".name_or_inspect" do
|
61
61
|
before :each do
|
62
|
-
@mock =
|
62
|
+
@mock = double("I have a #name")
|
63
63
|
end
|
64
64
|
|
65
65
|
it "returns the value of @name if set" do
|
@@ -70,9 +70,9 @@ end
|
|
70
70
|
|
71
71
|
describe Mock, ".install_method for mocks" do
|
72
72
|
before :each do
|
73
|
-
@mock =
|
74
|
-
MSpec.stub
|
75
|
-
MSpec.stub
|
73
|
+
@mock = double('install_method')
|
74
|
+
MSpec.stub(:actions)
|
75
|
+
MSpec.stub(:current).and_return(double("spec state").as_null_object)
|
76
76
|
end
|
77
77
|
|
78
78
|
after :each do
|
@@ -123,8 +123,8 @@ describe Mock, ".install_method for mocks" do
|
|
123
123
|
end
|
124
124
|
|
125
125
|
it "adds to the expectation tally" do
|
126
|
-
state =
|
127
|
-
state.stub
|
126
|
+
state = double("run state").as_null_object
|
127
|
+
state.stub(:state).and_return(double("spec state"))
|
128
128
|
MSpec.should_receive(:current).and_return(state)
|
129
129
|
MSpec.should_receive(:actions).with(:expectation, state.state)
|
130
130
|
Mock.install_method(@mock, :method_call).and_return(1)
|
@@ -132,8 +132,8 @@ describe Mock, ".install_method for mocks" do
|
|
132
132
|
end
|
133
133
|
|
134
134
|
it "registers that an expectation has been encountered" do
|
135
|
-
state =
|
136
|
-
state.stub
|
135
|
+
state = double("run state").as_null_object
|
136
|
+
state.stub(:state).and_return(double("spec state"))
|
137
137
|
MSpec.should_receive(:expectation)
|
138
138
|
Mock.install_method(@mock, :method_call).and_return(1)
|
139
139
|
@mock.method_call.should == 1
|
@@ -142,9 +142,9 @@ end
|
|
142
142
|
|
143
143
|
describe Mock, ".install_method for stubs" do
|
144
144
|
before :each do
|
145
|
-
@mock =
|
146
|
-
MSpec.stub
|
147
|
-
MSpec.stub
|
145
|
+
@mock = double('install_method')
|
146
|
+
MSpec.stub(:actions)
|
147
|
+
MSpec.stub(:current).and_return(double("spec state").as_null_object)
|
148
148
|
end
|
149
149
|
|
150
150
|
after :each do
|
@@ -157,12 +157,12 @@ describe Mock, ".install_method for stubs" do
|
|
157
157
|
|
158
158
|
# This illustrates RSpec's behavior. This spec passes on RSpec and we mimic it
|
159
159
|
#
|
160
|
-
# describe "A mock receiving multiple calls to #stub
|
160
|
+
# describe "A mock receiving multiple calls to #stub" do
|
161
161
|
# it "returns the last value stubbed" do
|
162
|
-
# m = mock 'multiple #stub
|
163
|
-
# m.stub
|
162
|
+
# m = mock 'multiple #stub'
|
163
|
+
# m.stub(:foo).and_return(true)
|
164
164
|
# m.foo.should == true
|
165
|
-
# m.stub
|
165
|
+
# m.stub(:foo).and_return(false)
|
166
166
|
# m.foo.should == false
|
167
167
|
# end
|
168
168
|
# end
|
@@ -175,8 +175,8 @@ describe Mock, ".install_method for stubs" do
|
|
175
175
|
end
|
176
176
|
|
177
177
|
it "does not add to the expectation tally" do
|
178
|
-
state =
|
179
|
-
state.stub
|
178
|
+
state = double("run state").as_null_object
|
179
|
+
state.stub(:state).and_return(double("spec state"))
|
180
180
|
MSpec.should_not_receive(:actions)
|
181
181
|
Mock.install_method(@mock, :method_call, :stub).and_return(1)
|
182
182
|
@mock.method_call.should == 1
|
@@ -185,9 +185,9 @@ end
|
|
185
185
|
|
186
186
|
describe Mock, ".install_method" do
|
187
187
|
before :each do
|
188
|
-
@mock =
|
189
|
-
MSpec.stub
|
190
|
-
MSpec.stub
|
188
|
+
@mock = double('install_method')
|
189
|
+
MSpec.stub(:actions)
|
190
|
+
MSpec.stub(:current).and_return(double("spec state").as_null_object)
|
191
191
|
end
|
192
192
|
|
193
193
|
after :each do
|
@@ -211,10 +211,10 @@ class MockAndRaiseError < Exception; end
|
|
211
211
|
|
212
212
|
describe Mock, ".verify_call" do
|
213
213
|
before :each do
|
214
|
-
MSpec.stub
|
215
|
-
MSpec.stub
|
214
|
+
MSpec.stub(:actions)
|
215
|
+
MSpec.stub(:current).and_return(double("spec state").as_null_object)
|
216
216
|
|
217
|
-
@mock =
|
217
|
+
@mock = double('verify_call')
|
218
218
|
@proxy = Mock.install_method @mock, :method_call
|
219
219
|
end
|
220
220
|
|
@@ -302,9 +302,9 @@ describe Mock, ".verify_call" do
|
|
302
302
|
|
303
303
|
it "does not raise an expection when it is expected to yield to a block that can take any number of arguments" do
|
304
304
|
@proxy.and_yield(1, 2, 3)
|
305
|
-
|
305
|
+
expect {
|
306
306
|
Mock.verify_call(@mock, :method_call) {|*a|}
|
307
|
-
}.
|
307
|
+
}.not_to raise_error
|
308
308
|
end
|
309
309
|
|
310
310
|
it "raises an exception when expected to" do
|
@@ -317,10 +317,10 @@ end
|
|
317
317
|
|
318
318
|
describe Mock, ".verify_count" do
|
319
319
|
before :each do
|
320
|
-
MSpec.stub
|
321
|
-
MSpec.stub
|
320
|
+
MSpec.stub(:actions)
|
321
|
+
MSpec.stub(:current).and_return(double("spec state").as_null_object)
|
322
322
|
|
323
|
-
@mock =
|
323
|
+
@mock = double('verify_count')
|
324
324
|
@proxy = Mock.install_method @mock, :method_call
|
325
325
|
end
|
326
326
|
|
@@ -380,10 +380,10 @@ end
|
|
380
380
|
|
381
381
|
describe Mock, ".verify_count mixing mocks and stubs" do
|
382
382
|
before :each do
|
383
|
-
MSpec.stub
|
384
|
-
MSpec.stub
|
383
|
+
MSpec.stub(:actions)
|
384
|
+
MSpec.stub(:current).and_return(double("spec state").as_null_object)
|
385
385
|
|
386
|
-
@mock =
|
386
|
+
@mock = double('verify_count')
|
387
387
|
end
|
388
388
|
|
389
389
|
after :each do
|
@@ -412,10 +412,10 @@ end
|
|
412
412
|
|
413
413
|
describe Mock, ".cleanup" do
|
414
414
|
before :each do
|
415
|
-
MSpec.stub
|
416
|
-
MSpec.stub
|
415
|
+
MSpec.stub(:actions)
|
416
|
+
MSpec.stub(:current).and_return(double("spec state").as_null_object)
|
417
417
|
|
418
|
-
@mock =
|
418
|
+
@mock = double('cleanup')
|
419
419
|
@proxy = Mock.install_method @mock, :method_call
|
420
420
|
@stub = Mock.install_method @mock, :method_call, :stub
|
421
421
|
end
|
data/spec/mocks/proxy_spec.rb
CHANGED