Permalink
Browse files

make ConnectionPool#timeout attribute writable

  • Loading branch information...
1 parent e69c6a6 commit 9364954763aeea2c9253e8c2a9fc7eaacd770642 @davidsulc davidsulc committed Jun 3, 2011
Showing with 10 additions and 2 deletions.
  1. +2 −1 lib/sugarcrm/connection_pool.rb
  2. +8 −1 test/test_connection_pool.rb
@@ -1,7 +1,8 @@
require 'monitor'
module SugarCRM; class ConnectionPool
- attr_reader :size, :timeout
+ attr_accessor :timeout
+ attr_reader :size
def initialize(session)
@session = session
@@ -17,7 +17,7 @@ class TestConnectionPool < ActiveSupport::TestCase
end
end
- should "be able to specify its timeout" do
+ should "be able to specify its timeout on creation" do
default_timeout = SugarCRM.session.connection_pool.timeout
config = SugarCRM.session.config
@@ -29,5 +29,12 @@ class TestConnectionPool < ActiveSupport::TestCase
sess.disconnect!
end
end
+
+ should "be able to specify its timeout after creation" do
+ timeout = SugarCRM.session.connection_pool.timeout
+ SugarCRM.session.connection_pool.timeout += 1
+
+ assert_equal timeout + 1, SugarCRM.session.connection_pool.timeout
+ end
end
end

0 comments on commit 9364954

Please sign in to comment.