diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-03-28 16:08:42 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-03-28 16:08:42 -0700 |
commit | 7b4866e0aef1ed8ec08fd9eac104df42bce3c1c9 (patch) | |
tree | d23f04310581caf0da869ba0c0df7ce7a75a30d0 /activerecord | |
parent | e1a5007207b8bd9e91711428acc3104f4c8e8fb8 (diff) | |
download | rails-7b4866e0aef1ed8ec08fd9eac104df42bce3c1c9.tar.gz rails-7b4866e0aef1ed8ec08fd9eac104df42bce3c1c9.tar.bz2 rails-7b4866e0aef1ed8ec08fd9eac104df42bce3c1c9.zip |
namespacing connection management tests. :heart:
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/test/cases/connection_management_test.rb | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/activerecord/test/cases/connection_management_test.rb b/activerecord/test/cases/connection_management_test.rb index c535119972..c5511673ac 100644 --- a/activerecord/test/cases/connection_management_test.rb +++ b/activerecord/test/cases/connection_management_test.rb @@ -1,25 +1,29 @@ require "cases/helper" -class ConnectionManagementTest < ActiveRecord::TestCase - def setup - @env = {} - @app = stub('App') - @management = ActiveRecord::ConnectionAdapters::ConnectionManagement.new(@app) +module ActiveRecord + module ConnectionAdapters + class ConnectionManagementTest < ActiveRecord::TestCase + def setup + @env = {} + @app = stub('App') + @management = ConnectionManagement.new(@app) - @connections_cleared = false - ActiveRecord::Base.stubs(:clear_active_connections!).with { @connections_cleared = true } - end + @connections_cleared = false + ActiveRecord::Base.stubs(:clear_active_connections!).with { @connections_cleared = true } + end - test "clears active connections after each call" do - @app.expects(:call).with(@env) - @management.call(@env) - assert @connections_cleared - end + test "clears active connections after each call" do + @app.expects(:call).with(@env) + @management.call(@env) + assert @connections_cleared + end - test "doesn't clear active connections when running in a test case" do - @env['rack.test'] = true - @app.expects(:call).with(@env) - @management.call(@env) - assert !@connections_cleared + test "doesn't clear active connections when running in a test case" do + @env['rack.test'] = true + @app.expects(:call).with(@env) + @management.call(@env) + assert !@connections_cleared + end + end end end |