Permalink
Browse files

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.
  • Loading branch information...
1 parent c381d5c commit 1e17a9d367c54c680368be72f44247ae28b98904 Steve Jorgensen committed Aug 8, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 activerecord/test/cases/adapters/postgresql/connection_test.rb
@@ -92,9 +92,9 @@ def test_reconnection_after_simulated_disconnection_with_verify
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

0 comments on commit 1e17a9d

Please sign in to comment.