Stub instance method :backtrace, insted of defining it

This commit is contained in:
Yosuke Kabuto 2016-05-29 20:20:59 +09:00
parent 657bfc0e01
commit ab8cfe5208
1 changed files with 2 additions and 4 deletions

View File

@ -80,10 +80,8 @@ RSpec.describe Google::Apis::Error do
context '@cause is falsy' do
before do
subject.class.superclass.class_eval do
def backtrace
"super class's #backtrace called"
end
subject.class.superclass.any_instance.stub(:backtrace) do
"super class's #backtrace called"
end
end