diff options
| author | Richard Soderberg <rs@pi007.sv2.upperbeyond.com> | 2009-08-24 19:57:07 -0700 |
|---|---|---|
| committer | James Turnbull <james@lovedthanlost.net> | 2009-11-20 08:07:52 +1100 |
| commit | c9f40be6c567d8de328b9d79dde357672323925a (patch) | |
| tree | 1ed7730149eb8ac9efc26c96934ff7dfda903a5e /spec/unit | |
| parent | 2d137e2e1ce603ee2727d66b1aba57458bf4d1be (diff) | |
| download | puppet-c9f40be6c567d8de328b9d79dde357672323925a.tar.gz puppet-c9f40be6c567d8de328b9d79dde357672323925a.tar.xz puppet-c9f40be6c567d8de328b9d79dde357672323925a.zip | |
Fixed #2568 - Add database option 'dbconnections'
This sets the ActiveRecords connection pool size, when connecting to remote databases (mysql, postgres). default is 0; the 'pool' argument is only passed to ActiveRecords when the value is 1 or greater.
Diffstat (limited to 'spec/unit')
| -rwxr-xr-x | spec/unit/rails.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/unit/rails.rb b/spec/unit/rails.rb index d838f0b8f..8ecd77a49 100755 --- a/spec/unit/rails.rb +++ b/spec/unit/rails.rb @@ -117,6 +117,28 @@ describe Puppet::Rails, "when initializing a mysql connection" do :socket => "testsocket" } end + + it "should provide the adapter, log_level, and host, username, password, database, socket, and connections arguments" do + Puppet.settings.stubs(:value).with(:dbadapter).returns("mysql") + Puppet.settings.stubs(:value).with(:rails_loglevel).returns("testlevel") + Puppet.settings.stubs(:value).with(:dbserver).returns("testserver") + Puppet.settings.stubs(:value).with(:dbuser).returns("testuser") + Puppet.settings.stubs(:value).with(:dbpassword).returns("testpassword") + Puppet.settings.stubs(:value).with(:dbname).returns("testname") + Puppet.settings.stubs(:value).with(:dbsocket).returns("testsocket") + Puppet.settings.stubs(:value).with(:dbconnections).returns(1) + + Puppet::Rails.database_arguments.should == { + :adapter => "mysql", + :log_level => "testlevel", + :host => "testserver", + :username => "testuser", + :password => "testpassword", + :database => "testname", + :socket => "testsocket", + :pool => 1 + } + end end describe Puppet::Rails, "when initializing a postgresql connection" do |
