Hello folks, 

I'm trying to test the return value of a method after an exception is 
called and I'm unsure of how to actually test this. I basically want to 
throw away the exception to see the return value. See the super contrived 
example below:

class Foo
  def call
    Bar.new.call
  end
end

class Bar
  def call
    Meep.new.call
  end
end

class Meep
  def call
    "no error"
  rescue ArgumentError
    "error"
  end
end

allow_any_instance_of(Meep).to receive(:call).and_raise(ArgumentError)
expect(Foo.new.call).to eq "error"




-- 
You received this message because you are subscribed to the Google Groups 
"rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rspec/9a05e52f-21c5-49bf-808b-e826261f9936%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to