Permalink
Browse files

Merge pull request #88 from mvz/no-warnings

Fix warnings
  • Loading branch information...
2 parents c3728d5 + c3c8a97 commit a02c59bee8668799533073d6994aace6b8d2ce76 @dchelimsky dchelimsky committed Oct 30, 2011
View
@@ -9,6 +9,7 @@ require 'cucumber/rake/task'
desc "Run all examples"
RSpec::Core::RakeTask.new(:spec) do |t|
+ t.ruby_opts = %w[-w]
t.rspec_opts = %w[--color]
end
@@ -156,7 +156,6 @@ def mark_invoked!(method_name)
@klass.class_eval(<<-EOM, __FILE__, __LINE__)
def #{method_name}(*args, &blk)
method_name = :#{method_name}
- current_instance = self
invoked_instance = self.class.__recorder.instance_that_received(method_name)
raise RSpec::Mocks::MockExpectationError, "The message '#{method_name}' was received by \#{self.inspect} but has already been received by \#{invoked_instance}"
end
@@ -60,7 +60,7 @@ def ==(actual)
return false unless actual.has_key?(key) && value == actual[key]
end
true
- rescue NoMethodError => ex
+ rescue NoMethodError
return false
end
@@ -79,7 +79,7 @@ def ==(actual)
return false if actual.has_key?(key) && value == actual[key]
end
true
- rescue NoMethodError => ex
+ rescue NoMethodError
return false
end
@@ -19,7 +19,7 @@
it "can remove all stub chains" do
chains.add(:method_name, stub_chain)
chains.add(:method_name, expectation_chain)
- chains.add(:method_name, another_stub_chain = RSpec::Mocks::AnyInstance::StubChain.new)
+ chains.add(:method_name, RSpec::Mocks::AnyInstance::StubChain.new)
chains.remove_stub_chains_for!(:method_name)
chains[:method_name].should eq([expectation_chain])
@@ -38,7 +38,7 @@ def reset?
@space.reset_all
end
it "clears internal mocks on reset_all" do
- @space.add(m = double("mock"))
+ @space.add(double("mock"))
@space.reset_all
@space.instance_eval { mocks.empty? }.should be_true
end
@@ -61,7 +61,6 @@ module Mocks
end
it "complains when there are too few calls" do
- third = Object.new
@mock.message.should eq @return_values[0]
@mock.message.should eq @return_values[1]
expect { @mock.rspec_verify }.to raise_error(
@@ -71,7 +70,6 @@ module Mocks
end
it "complains when there are too many calls" do
- third = Object.new
@mock.message.should eq @return_values[0]
@mock.message.should eq @return_values[1]
@mock.message.should eq @return_values[2]
@@ -83,7 +81,6 @@ module Mocks
end
it "complains when there are too many calls and method is stubbed too" do
- third = Object.new
@mock.stub(:message).and_return :stub_result
@mock.message.should eq @return_values[0]
@mock.message.should eq @return_values[1]
@@ -5,7 +5,7 @@ def remove_last_describe_from_world
end
def empty_example_group
- group = RSpec::Core::ExampleGroup.describe(Object, 'Empty Behaviour Group') { }
+ RSpec::Core::ExampleGroup.describe(Object, 'Empty Behaviour Group') { }
remove_last_describe_from_world
end
@@ -67,7 +67,7 @@ def set_stub
compiled_with_psych = begin
require 'psych'
true
- rescue LoadError => e
+ rescue LoadError
false
end

0 comments on commit a02c59b

Please sign in to comment.