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.
@@ -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 => ex
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 => ex
82
+ rescue NoMethodError
83
83
  return false
84
84
  end
85
85
 
@@ -1,7 +1,7 @@
1
1
  module RSpec
2
2
  module Mocks
3
3
  module Version
4
- STRING = '2.7.0'
4
+ STRING = '2.8.0.rc1'
5
5
  end
6
6
  end
7
7
  end
@@ -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, another_stub_chain = RSpec::Mocks::AnyInstance::StubChain.new)
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])
@@ -38,7 +38,7 @@ module RSpec
38
38
  @space.reset_all
39
39
  end
40
40
  it "clears internal mocks on reset_all" do
41
- @space.add(m = double("mock"))
41
+ @space.add(double("mock"))
42
42
  @space.reset_all
43
43
  @space.instance_eval { mocks.empty? }.should be_true
44
44
  end
@@ -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
- group = RSpec::Core::ExampleGroup.describe(Object, 'Empty Behaviour Group') { }
8
+ RSpec::Core::ExampleGroup.describe(Object, 'Empty Behaviour Group') { }
9
9
  remove_last_describe_from_world
10
10
  end
11
11
 
@@ -67,7 +67,7 @@ module RSpec
67
67
  compiled_with_psych = begin
68
68
  require 'psych'
69
69
  true
70
- rescue LoadError => e
70
+ rescue LoadError
71
71
  false
72
72
  end
73
73
 
@@ -36,6 +36,7 @@ end
36
36
  RSpec.configure do |config|
37
37
  config.mock_with :rspec
38
38
  config.color_enabled = true
39
+ config.order = :random
39
40
  config.extend(Macros)
40
41
  config.include(RSpec::Mocks::Methods)
41
42
 
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: 19
5
- prerelease:
4
+ hash: 15424215
5
+ prerelease: 6
6
6
  segments:
7
7
  - 2
8
- - 7
8
+ - 8
9
9
  - 0
10
- version: 2.7.0
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-10-16 00:00:00 Z
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: 3
152
+ hash: 25
151
153
  segments:
152
- - 0
153
- version: "0"
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.7.0
164
+ summary: rspec-mocks-2.8.0.rc1
161
165
  test_files:
162
166
  - features/README.markdown
163
167
  - features/Scope.md