summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/puppet/rails.rb1
-rwxr-xr-xspec/unit/rails.rb10
2 files changed, 7 insertions, 4 deletions
diff --git a/lib/puppet/rails.rb b/lib/puppet/rails.rb
index 98d8297fe..98c0e3d32 100644
--- a/lib/puppet/rails.rb
+++ b/lib/puppet/rails.rb
@@ -54,6 +54,7 @@ module Puppet::Rails
args[:username] = Puppet[:dbuser] unless Puppet[:dbuser].empty?
args[:password] = Puppet[:dbpassword] unless Puppet[:dbpassword].empty?
args[:database] = Puppet[:dbname]
+ args[:reconnect]= true
socket = Puppet[:dbsocket]
args[:socket] = socket unless socket.empty?
diff --git a/spec/unit/rails.rb b/spec/unit/rails.rb
index 03028734a..f61288f7a 100755
--- a/spec/unit/rails.rb
+++ b/spec/unit/rails.rb
@@ -90,7 +90,7 @@ end
describe Puppet::Rails, "when initializing a mysql or postgresql connection" do
confine "Cannot test without ActiveRecord" => Puppet.features.rails?
- it "should provide the adapter, log_level, and host, username, password, and database arguments" do
+ it "should provide the adapter, log_level, and host, username, password, database, and reconnect 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")
@@ -105,11 +105,12 @@ describe Puppet::Rails, "when initializing a mysql or postgresql connection" do
:host => "testserver",
:username => "testuser",
:password => "testpassword",
- :database => "testname"
+ :database => "testname",
+ :reconnect => true
}
end
- it "should provide the adapter, log_level, and host, username, password, database, and socket arguments" do
+ it "should provide the adapter, log_level, and host, username, password, database, socket, and reconnect 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")
@@ -125,7 +126,8 @@ describe Puppet::Rails, "when initializing a mysql or postgresql connection" do
:username => "testuser",
:password => "testpassword",
:database => "testname",
- :socket => "testsocket"
+ :socket => "testsocket",
+ :reconnect => true
}
end
end