summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-12-15 00:11:00 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-12-15 00:11:00 +0000
commit0cd579997a8ea619968c58a39493d28b9af87e6d (patch)
tree7dae1fec31ee2545b98fd10c0a581c641270c950 /test
parent6d9ae0cf32f43cbcffa2ac8fb355c65d8ceeb9a0 (diff)
downloadpuppet-0cd579997a8ea619968c58a39493d28b9af87e6d.tar.gz
puppet-0cd579997a8ea619968c58a39493d28b9af87e6d.tar.xz
puppet-0cd579997a8ea619968c58a39493d28b9af87e6d.zip
Some rails modifications
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1931 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test')
-rw-r--r--test/lib/puppettest/railstesting.rb4
-rwxr-xr-xtest/rails/rails.rb17
2 files changed, 14 insertions, 7 deletions
diff --git a/test/lib/puppettest/railstesting.rb b/test/lib/puppettest/railstesting.rb
index 3b65f5b34..baac6e03a 100644
--- a/test/lib/puppettest/railstesting.rb
+++ b/test/lib/puppettest/railstesting.rb
@@ -8,7 +8,9 @@ module PuppetTest::RailsTesting
end
def railsteardown
- Puppet::Rails.teardown
+ if Puppet[:dbadapter] != "sqlite3"
+ Puppet::Rails.teardown
+ end
end
def railsresource(type = "file", title = "/tmp/testing", params = {})
diff --git a/test/rails/rails.rb b/test/rails/rails.rb
index 381150be3..05fad4c87 100755
--- a/test/rails/rails.rb
+++ b/test/rails/rails.rb
@@ -24,7 +24,17 @@ class TestRails < Test::Unit::TestCase
end
# Don't do any tests w/out this class
- if defined? ActiveRecord::Base
+ if Puppet.features.rails?
+ def setup
+ super
+ railsinit
+ end
+
+ def teardown
+ super
+ railsteardown
+ end
+
def test_hostcache
railsinit
@interp, @scope, @source = mkclassframing
@@ -38,11 +48,6 @@ class TestRails < Test::Unit::TestCase
# Now collect our facts
facts = Facter.to_hash
- assert_nothing_raised {
- Puppet::Rails.teardown
- Puppet::Rails.init
- }
-
# Now try storing our crap
host = nil
assert_nothing_raised {