mspec 1.7.0 → 1.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +9 -7
  3. data/lib/mspec/commands/mspec.rb +0 -8
  4. data/lib/mspec/guards/platform.rb +4 -0
  5. data/lib/mspec/helpers/environment.rb +12 -22
  6. data/lib/mspec/helpers/io.rb +6 -1
  7. data/lib/mspec/helpers/mock_to_path.rb +1 -1
  8. data/lib/mspec/helpers/ruby_exe.rb +8 -3
  9. data/lib/mspec/runner/actions.rb +0 -1
  10. data/lib/mspec/utils/options.rb +0 -4
  11. data/lib/mspec/utils/script.rb +0 -1
  12. data/lib/mspec/version.rb +1 -1
  13. data/spec/commands/mkspec_spec.rb +31 -31
  14. data/spec/commands/mspec_ci_spec.rb +14 -14
  15. data/spec/commands/mspec_run_spec.rb +4 -4
  16. data/spec/commands/mspec_spec.rb +33 -56
  17. data/spec/commands/mspec_tag_spec.rb +26 -26
  18. data/spec/guards/background_spec.rb +1 -1
  19. data/spec/guards/block_device_spec.rb +1 -1
  20. data/spec/guards/bug_spec.rb +4 -4
  21. data/spec/guards/compliance_spec.rb +2 -2
  22. data/spec/guards/conflict_spec.rb +5 -5
  23. data/spec/guards/endian_spec.rb +8 -8
  24. data/spec/guards/extensions_spec.rb +1 -1
  25. data/spec/guards/feature_spec.rb +1 -1
  26. data/spec/guards/guard_spec.rb +20 -20
  27. data/spec/guards/noncompliance_spec.rb +1 -1
  28. data/spec/guards/platform_spec.rb +14 -14
  29. data/spec/guards/quarantine_spec.rb +1 -1
  30. data/spec/guards/runner_spec.rb +7 -7
  31. data/spec/guards/specified_spec.rb +7 -7
  32. data/spec/guards/superuser_spec.rb +3 -3
  33. data/spec/guards/support_spec.rb +1 -1
  34. data/spec/guards/tty_spec.rb +1 -1
  35. data/spec/guards/user_spec.rb +3 -3
  36. data/spec/guards/version_spec.rb +3 -3
  37. data/spec/helpers/ducktype_spec.rb +3 -3
  38. data/spec/helpers/environment_spec.rb +18 -10
  39. data/spec/helpers/flunk_spec.rb +2 -2
  40. data/spec/helpers/io_spec.rb +2 -2
  41. data/spec/helpers/ruby_exe_spec.rb +5 -9
  42. data/spec/matchers/have_singleton_method_spec.rb +1 -1
  43. data/spec/matchers/output_spec.rb +1 -1
  44. data/spec/mocks/mock_spec.rb +41 -41
  45. data/spec/mocks/proxy_spec.rb +1 -1
  46. data/spec/runner/actions/filter_spec.rb +1 -1
  47. data/spec/runner/actions/tag_spec.rb +17 -17
  48. data/spec/runner/actions/taglist_spec.rb +8 -8
  49. data/spec/runner/actions/tagpurge_spec.rb +11 -11
  50. data/spec/runner/actions/timer_spec.rb +4 -4
  51. data/spec/runner/context_spec.rb +32 -32
  52. data/spec/runner/example_spec.rb +1 -1
  53. data/spec/runner/filters/profile_spec.rb +2 -2
  54. data/spec/runner/filters/tag_spec.rb +6 -6
  55. data/spec/runner/formatters/describe_spec.rb +6 -6
  56. data/spec/runner/formatters/dotted_spec.rb +10 -10
  57. data/spec/runner/formatters/file_spec.rb +2 -2
  58. data/spec/runner/formatters/html_spec.rb +10 -10
  59. data/spec/runner/formatters/junit_spec.rb +11 -11
  60. data/spec/runner/formatters/method_spec.rb +3 -3
  61. data/spec/runner/formatters/specdoc_spec.rb +1 -1
  62. data/spec/runner/formatters/spinner_spec.rb +4 -4
  63. data/spec/runner/formatters/unit_spec.rb +7 -7
  64. data/spec/runner/formatters/yaml_spec.rb +10 -10
  65. data/spec/runner/mspec_spec.rb +25 -25
  66. data/spec/runner/shared_spec.rb +1 -1
  67. data/spec/utils/options_spec.rb +28 -50
  68. data/spec/utils/script_spec.rb +15 -24
  69. metadata +12 -16
  70. data/lib/mspec/runner/actions/gdb.rb +0 -17
  71. data/spec/runner/actions/gdb_spec.rb +0 -61
@@ -6,7 +6,7 @@ describe Object, "#with_tty" do
6
6
  ScratchPad.clear
7
7
 
8
8
  @guard = TTYGuard.new
9
- TTYGuard.stub!(:new).and_return(@guard)
9
+ TTYGuard.stub(:new).and_return(@guard)
10
10
  end
11
11
 
12
12
  it "yields if STDOUT is a TTY" do
@@ -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!(:new).and_return(@guard)
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!(:euid).and_return(501)
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!(:euid).and_return(0)
18
+ Process.stub(:euid).and_return(0)
19
19
  as_user { ScratchPad.record :yield }
20
20
  ScratchPad.recorded.should_not == :yield
21
21
  end
@@ -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!(:new).and_return(@guard)
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!(:match?).and_return(true)
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!(:match?).and_return(false)
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 = mock("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 = mock("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 = mock("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!(:windows?).and_return(false)
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!(:windows?).and_return(true)
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!(:windows?).and_return(false)
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
- PlatformGuard.stub!(:windows?).and_return(true)
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!(:windows?).and_return(true)
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!(:windows?).and_return(false)
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!(:windows?).and_return(true)
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
- PlatformGuard.stub!(:windows?).and_return(false)
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
@@ -6,8 +6,8 @@ require 'mspec/helpers'
6
6
 
7
7
  describe Object, "#flunk" do
8
8
  before :each do
9
- MSpec.stub!(:actions)
10
- MSpec.stub!(:current).and_return(mock("spec state").as_null_object)
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
@@ -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!(:enabled?).and_return(true)
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!(:enabled?).and_return(true)
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!(:windows?).and_return(false)
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!(:windows?).and_return(true)
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!(:windows?).and_return(false)
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 = mock("HSMMSpecs")
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 { puts "unexpected"; $stderr.puts "unerror" }
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 ==
@@ -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 = mock('a fake id')
25
- m.stub!(:__mspec_object_id__).and_return(42)
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 = mock('a fake id')
33
- m.stub!(:__mspec_object_id__).and_return(42)
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 = mock('install_method')
41
- MSpec.stub!(:actions)
42
- MSpec.stub!(:current).and_return(mock("spec state").as_null_object)
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 = mock("I have a #name")
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 = mock('install_method')
74
- MSpec.stub!(:actions)
75
- MSpec.stub!(:current).and_return(mock("spec state").as_null_object)
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 = mock("run state").as_null_object
127
- state.stub!(:state).and_return(mock("spec state"))
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 = mock("run state").as_null_object
136
- state.stub!(:state).and_return(mock("spec state"))
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 = mock('install_method')
146
- MSpec.stub!(:actions)
147
- MSpec.stub!(:current).and_return(mock("spec state").as_null_object)
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!" do
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!(:foo).and_return(true)
162
+ # m = mock 'multiple #stub'
163
+ # m.stub(:foo).and_return(true)
164
164
  # m.foo.should == true
165
- # m.stub!(:foo).and_return(false)
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 = mock("run state").as_null_object
179
- state.stub!(:state).and_return(mock("spec state"))
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 = mock('install_method')
189
- MSpec.stub!(:actions)
190
- MSpec.stub!(:current).and_return(mock("spec state").as_null_object)
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!(:actions)
215
- MSpec.stub!(:current).and_return(mock("spec state").as_null_object)
214
+ MSpec.stub(:actions)
215
+ MSpec.stub(:current).and_return(double("spec state").as_null_object)
216
216
 
217
- @mock = mock('verify_call')
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
- lambda {
305
+ expect {
306
306
  Mock.verify_call(@mock, :method_call) {|*a|}
307
- }.should_not raise_error(SpecExpectationNotMetError)
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!(:actions)
321
- MSpec.stub!(:current).and_return(mock("spec state").as_null_object)
320
+ MSpec.stub(:actions)
321
+ MSpec.stub(:current).and_return(double("spec state").as_null_object)
322
322
 
323
- @mock = mock('verify_count')
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!(:actions)
384
- MSpec.stub!(:current).and_return(mock("spec state").as_null_object)
383
+ MSpec.stub(:actions)
384
+ MSpec.stub(:current).and_return(double("spec state").as_null_object)
385
385
 
386
- @mock = mock('verify_count')
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!(:actions)
416
- MSpec.stub!(:current).and_return(mock("spec state").as_null_object)
415
+ MSpec.stub(:actions)
416
+ MSpec.stub(:current).and_return(double("spec state").as_null_object)
417
417
 
418
- @mock = mock('cleanup')
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
@@ -340,7 +340,7 @@ describe MockProxy, "#raising" do
340
340
  end
341
341
 
342
342
  it "returns the exception object passed to #and_raise" do
343
- exc = mock("exception")
343
+ exc = double("exception")
344
344
  @proxy.and_raise(exc)
345
345
  @proxy.raising.should equal(exc)
346
346
  end