Fix only-once stub logic.
Didn't fail the test because adapter#query happens to not call raw connection's #query, but don't want to count on that and have a fragile test.
This commit is contained in:
parent
c381d5cbf9
commit
1e17a9d367
|
@ -92,9 +92,9 @@ module ActiveRecord
|
|||
def query_fake(*args)
|
||||
if !( @called ||= false )
|
||||
self.stubs(:status).returns(PGconn::CONNECTION_BAD)
|
||||
@called = true
|
||||
raise PGError
|
||||
else
|
||||
@called = true
|
||||
self.unstub(:status)
|
||||
query_unfake(*args)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue