[Pkg-puppet-devel] [facter] 241/352: (FACT-239) Delegate Fact#add to Fact#define_resolution

Stig Sandbeck Mathisen ssm at debian.org
Sun Apr 6 22:21:49 UTC 2014


This is an automated email from the git hooks/post-receive script.

ssm pushed a commit to branch master
in repository facter.

commit e86ff8dc98f2a782868974439f42894c08067d33
Author: Adrien Thebo <git at somethingsinistral.net>
Date:   Fri Jan 31 12:18:37 2014 -0800

    (FACT-239) Delegate Fact#add to Fact#define_resolution
---
 lib/facter/util/fact.rb           |  2 +-
 spec/unit/util/collection_spec.rb | 11 +++++------
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/lib/facter/util/fact.rb b/lib/facter/util/fact.rb
index b4a3e58..baec577 100644
--- a/lib/facter/util/fact.rb
+++ b/lib/facter/util/fact.rb
@@ -76,7 +76,7 @@ class Facter::Util::Fact
     end
 
   rescue => e
-    Facter.warn "Unable to add resolve #{resolve_name} for fact #{@name}: #{e}"
+    Facter.warn "Unable to add resolve #{resolve_name.inspect} for fact #{@name}: #{e}"
   end
 
   # Retrieve an existing resolution by name
diff --git a/spec/unit/util/collection_spec.rb b/spec/unit/util/collection_spec.rb
index b11b468..3b975d1 100755
--- a/spec/unit/util/collection_spec.rb
+++ b/spec/unit/util/collection_spec.rb
@@ -56,14 +56,13 @@ describe Facter::Util::Collection do
       end
 
       it "should discard resolutions that throw an exception when added" do
-        Facter.expects(:warn).with("Unable to add resolve for yay: ")
-        lambda {
+        Facter.expects(:warn).with(regexp_matches(/Unable to add resolve .* kaboom!/))
+        expect {
           collection.add('yay') do
-            raise
-            setcode { 'yay' }
+            raise "kaboom!"
           end
-        }.should_not raise_error
-        collection.value('yay').should be_nil
+        }.to_not raise_error
+        expect(collection.value('yay')).to be_nil
       end
     end
   end

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-puppet/facter.git



More information about the Pkg-puppet-devel mailing list