diff options
author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-06-19 01:49:19 +0000 |
---|---|---|
committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-06-19 01:49:19 +0000 |
commit | e5a9e24e839942d97f0b0f6dbd097f91f3c880f4 (patch) | |
tree | 328daacfee1ee7715e9dcd9628e1ba257ec686f4 | |
parent | bd444d84f403f0454533ee19e9da6893c054f3b4 (diff) | |
download | puppet-e5a9e24e839942d97f0b0f6dbd097f91f3c880f4.tar.gz puppet-e5a9e24e839942d97f0b0f6dbd097f91f3c880f4.tar.xz puppet-e5a9e24e839942d97f0b0f6dbd097f91f3c880f4.zip |
More test fixes. I seem to be getting very close.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2624 980ebf18-57e1-0310-9a29-db15c13687c0
-rw-r--r-- | lib/puppet/parser/interpreter.rb | 2 | ||||
-rwxr-xr-x | lib/puppet/provider/cron/crontab.rb | 7 | ||||
-rwxr-xr-x | test/network/xmlrpc/client.rb | 1 | ||||
-rwxr-xr-x | test/network/xmlrpc/processor.rb | 1 | ||||
-rwxr-xr-x | test/ral/providers/cron/crontab.rb | 3 | ||||
-rwxr-xr-x | test/ral/providers/mount/parsed.rb | 2 |
6 files changed, 12 insertions, 4 deletions
diff --git a/lib/puppet/parser/interpreter.rb b/lib/puppet/parser/interpreter.rb index 3a719e03c..f595c03a2 100644 --- a/lib/puppet/parser/interpreter.rb +++ b/lib/puppet/parser/interpreter.rb @@ -810,6 +810,8 @@ class Puppet::Parser::Interpreter unless ActiveRecord::Base.connected? Puppet::Rails.connect + else + Puppet.warning "Already connected" end # Fork the storage, since we don't need the client waiting diff --git a/lib/puppet/provider/cron/crontab.rb b/lib/puppet/provider/cron/crontab.rb index 7599b1bdf..19cce98a2 100755 --- a/lib/puppet/provider/cron/crontab.rb +++ b/lib/puppet/provider/cron/crontab.rb @@ -86,7 +86,6 @@ Puppet::Type.type(:cron).provide(:crontab, # See if we can match the hash against an existing cron job. def self.match(hash, resources) resources.each do |name, obj| - p hash # we now have a cron job whose command exactly matches # let's see if the other fields match @@ -151,7 +150,11 @@ Puppet::Type.type(:cron).provide(:crontab, record[:name] = name name = nil end - record[:environment] = envs + if envs.empty? + record[:environment] = :absent + else + record[:environment] = envs + end end }.reject { |record| record[:skip] } end diff --git a/test/network/xmlrpc/client.rb b/test/network/xmlrpc/client.rb index 427113227..2dec2c030 100755 --- a/test/network/xmlrpc/client.rb +++ b/test/network/xmlrpc/client.rb @@ -7,6 +7,7 @@ require 'puppet/network/xmlrpc/client' require 'mocha' class TestXMLRPCClient < Test::Unit::TestCase + include PuppetTest def test_set_backtrace error = Puppet::Network::XMLRPCClientError.new("An error") assert_nothing_raised do diff --git a/test/network/xmlrpc/processor.rb b/test/network/xmlrpc/processor.rb index 7ccd52131..02f0fbd2c 100755 --- a/test/network/xmlrpc/processor.rb +++ b/test/network/xmlrpc/processor.rb @@ -7,6 +7,7 @@ require 'puppet/network/xmlrpc/processor' require 'mocha' class TestXMLRPCProcessor < Test::Unit::TestCase + include PuppetTest class BaseProcessor def add_handler(interface, handler) @handlers ||= {} diff --git a/test/ral/providers/cron/crontab.rb b/test/ral/providers/cron/crontab.rb index 790a63de8..6a24288ef 100755 --- a/test/ral/providers/cron/crontab.rb +++ b/test/ral/providers/cron/crontab.rb @@ -91,6 +91,7 @@ class TestCronParsedProvider < Test::Unit::TestCase # Make the values a bit more equal. should[:target] = @me should[:ensure] = :present + #should[:environment] ||= [] should[:on_disk] = true is = sis.dup sis.dup.each do |p,v| @@ -270,7 +271,7 @@ class TestCronParsedProvider < Test::Unit::TestCase hash = @provider.parse_line(str) hash[:user] = @me - instance = @provider.match(hash) + instance = @provider.match(hash, "yaycron" => cron) assert(instance, "did not match cron") assert_equal(cron, instance, "Did not match cron job") diff --git a/test/ral/providers/mount/parsed.rb b/test/ral/providers/mount/parsed.rb index 8dc8306b9..bd0091ad3 100755 --- a/test/ral/providers/mount/parsed.rb +++ b/test/ral/providers/mount/parsed.rb @@ -124,7 +124,7 @@ class TestParsedMounts < Test::Unit::TestCase assert(root, "Could not retrieve root mount") assert_nothing_raised("Could not rewrite file") do - puts @provider.to_file(hashes) + @provider.to_file(hashes) end end end |