Skip to content

Commit

Permalink
make ganglia_validate_clusters output consistently testable
Browse files Browse the repository at this point in the history
Between Ruby 1.8.7 and 1.9.3+
  • Loading branch information
Joshua Hoblitt committed May 16, 2014
1 parent 59d378d commit fbbeb0e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/puppet/parser/functions/ganglia_validate_clusters.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ module Puppet::Parser::Functions
# any other keys should be rejected
extras = c.keys - %w{ name address polling_interval }
if extras.length > 0
raise Puppet::ParseError, ("ganglia_validate_clusters(): nested Hash contains unknown keys (#{extras.sort})")
raise Puppet::ParseError, ("ganglia_validate_clusters(): nested Hash contains unknown keys (#{extras.sort.join(' ')})")
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/functions/ganglia_validate_clusters_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
it 'should fail with unknown keys' do
clusters = [{ 'name' => 'my cluster', 'address' => 'localhost', 'polling_interval' => 10, 'foo' => 1, 'bar' => 2 }]
expect { subject.call([clusters]) }.
to raise_error(Puppet::ParseError, Regexp.new(Regexp.escape('contains unknown keys (["bar", "foo"])')))
to raise_error(Puppet::ParseError, /contains unknown keys \(bar foo\)/)
end

it 'work with reasonable input - simple example' do
Expand Down

0 comments on commit fbbeb0e

Please sign in to comment.