forked from localytics/odbc_adapter
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Somewhere along the line we lost the ability to reconnect! because options is no longer being set. This instead uses the already saved @config variable from the AbstractAdapter.
- Loading branch information
Showing
2 changed files
with
33 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
require 'test_helper' | ||
|
||
class ConnectionManagementTest < Minitest::Test | ||
def test_connection_management | ||
assert conn.active? | ||
|
||
conn.disconnect! | ||
refute conn.active? | ||
|
||
conn.disconnect! | ||
refute conn.active? | ||
|
||
conn.reconnect! | ||
assert conn.active? | ||
ensure | ||
conn.reconnect! | ||
end | ||
|
||
private | ||
|
||
def conn | ||
ActiveRecord::Base.connection | ||
end | ||
end |