Stub instance method :backtrace, insted of defining it
This commit is contained in:
		
							parent
							
								
									657bfc0e01
								
							
						
					
					
						commit
						ab8cfe5208
					
				|  | @ -80,12 +80,10 @@ RSpec.describe Google::Apis::Error do | ||||||
| 
 | 
 | ||||||
|     context '@cause is falsy' do |     context '@cause is falsy' do | ||||||
|       before do |       before do | ||||||
|         subject.class.superclass.class_eval do |         subject.class.superclass.any_instance.stub(:backtrace) do | ||||||
|           def backtrace |  | ||||||
|           "super class's #backtrace called" |           "super class's #backtrace called" | ||||||
|         end |         end | ||||||
|       end |       end | ||||||
|       end |  | ||||||
| 
 | 
 | ||||||
|       it "calls super class's #backtrace" do |       it "calls super class's #backtrace" do | ||||||
|         subject.instance_variable_set(:@cause, false) |         subject.instance_variable_set(:@cause, false) | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue