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:
Steve Jorgensen 2012-08-08 14:43:53 -07:00
parent c381d5cbf9
commit 1e17a9d367
1 changed files with 1 additions and 1 deletions

View File

@ -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