diff options
-rw-r--r-- | lib/puppet/provider/confine/variable.rb | 2 | ||||
-rwxr-xr-x | spec/integration/reference/providers.rb | 17 |
2 files changed, 18 insertions, 1 deletions
diff --git a/lib/puppet/provider/confine/variable.rb b/lib/puppet/provider/confine/variable.rb index 84d17367a..333356341 100644 --- a/lib/puppet/provider/confine/variable.rb +++ b/lib/puppet/provider/confine/variable.rb @@ -3,7 +3,7 @@ require 'puppet/provider/confine' class Puppet::Provider::Confine::Variable < Puppet::Provider::Confine def self.summarize(confines) result = Hash.new { |hash, key| hash[key] = [] } - confines.inject(result) { |total, confine| total[confine.fact] += confine.values unless confine.valid?; total } + confines.inject(result) { |total, confine| total[confine.class.name] += confine.values unless confine.valid?; total } end attr_accessor :name diff --git a/spec/integration/reference/providers.rb b/spec/integration/reference/providers.rb new file mode 100755 index 000000000..79b6ce12d --- /dev/null +++ b/spec/integration/reference/providers.rb @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby + +Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") } + +require 'puppet/util/reference' + +reference = Puppet::Util::Reference.reference(:providers) + +describe reference do + it "should exist" do + reference.should_not be_nil + end + + it "should be able to be rendered as text" do + lambda { reference.to_text }.should_not raise_error + end +end |