Permalink
Browse files

Fixed another warning.

  • Loading branch information...
1 parent e13f51c commit 42745074759db7df38f0d52ae8eb63bfefe88a50 Brian Takita committed Oct 18, 2009
View
3 lib/rr/adapters/rspec.rb
@@ -24,10 +24,11 @@ def have_received(method = nil)
end
class InvocationMatcher < SpyVerificationProxy
- attr_reader :failure_message
+ attr_reader :failure_message, :spy_verification_proxy
def initialize(method = nil)
@verification = nil
+ @subject = nil
method_missing(method) if method
end
View
1 spec/rr/double_definitions/double_definition_spec.rb
@@ -886,6 +886,7 @@ def call_double_injection
context "when passed a Method" do
it "sets the implementation to the passed in method" do
class << subject
+ remove_method :foobar
def foobar(a, b)
[b, a]
end
View
12 spec/rr/double_injection/double_injection_spec.rb
@@ -11,10 +11,13 @@ module Injections
end
end
+ before do
+ @subject = Object.new
+ end
+
describe "mock/stub" do
context "when the subject responds to the injected method" do
before do
- @subject = Object.new
class << subject
attr_reader :original_foobar_called
@@ -63,7 +66,6 @@ def foobar
context "when the subject does not respond to the injected method" do
before do
- @subject = Object.new
subject.should_not respond_to(:foobar)
subject.methods.should_not include('foobar')
stub(subject).foobar {:new_foobar}
@@ -109,8 +111,6 @@ def respond_to?(method_symbol, include_private = false)
context "when the subject has the method defined" do
describe "being bound" do
before do
- @subject = Object.new
-
def subject.foobar
:original_foobar
end
@@ -157,7 +157,6 @@ def subject.foobar
describe "being bound" do
context "when the subject has not been previously bound to" do
before do
- @subject = Object.new
setup_subject
subject.should respond_to(:foobar)
@@ -309,7 +308,6 @@ def subject.method_missing(method_name, *args, &block)
context "when the subject has been previously bound to" do
before do
- @subject = Object.new
setup_subject
subject.should respond_to(:foobar)
@@ -467,7 +465,6 @@ def subject.method_missing(method_name, *args, &block)
context "when the subject responds to the method via method_missing" do
describe "being bound" do
before do
- @subject = Object.new
subject.should_not respond_to(:foobar)
subject.methods.should_not include('foobar')
class << subject
@@ -512,7 +509,6 @@ def method_missing(method_name, *args, &block)
context "when the subject would raise a NoMethodError when the method is called" do
describe "being bound" do
before do
- @subject = Object.new
subject.should_not respond_to(:foobar)
subject.methods.should_not include('foobar')
stub.proxy(subject).foobar {:new_foobar}

0 comments on commit 4274507

Please sign in to comment.