Skip to content

Commit

Permalink
Error messages changed since stronger typing added
Browse files Browse the repository at this point in the history
  • Loading branch information
traylenator committed Sep 22, 2023
1 parent 04b91cc commit 32b6200
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion spec/classes/augeasproviders_instances_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
context "when resource_defaults => 'foo'" do
let(:params) { { resource_defaults: 'foo' } }

it { expect { is_expected.to create_class('augeasproviders::instances') }.to raise_error(Puppet::Error, %r{is not a Hash}) }
it { expect { is_expected.to create_class('augeasproviders::instances') }.to raise_error(Puppet::Error, %r{expects a Hash value, got String}) }
end

%w[
Expand Down
4 changes: 2 additions & 2 deletions spec/support/validate_hash.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
let(:params) { { hash_param_name.to_sym => 'FOO' } }
let(:facts) { {} }

it { expect { is_expected.to create_class('augeasproviders') }.to raise_error(Puppet::Error, %r{is not a Hash}) }
it { expect { is_expected.to create_class('augeasproviders') }.to raise_error(Puppet::Error, %r{expects a Hash value, got String}) }
end
end

Expand All @@ -14,6 +14,6 @@
let(:params) { {} }
let(:facts) { { hash_variable_name.to_sym => 'FOO' } }

it { expect { is_expected.to create_class('augeasproviders') }.to raise_error(Puppet::Error, %r{is not a Hash}) }
it { expect { is_expected.to create_class('augeasproviders') }.to raise_error(Puppet::Error, %r{expects a Hash value, got String}) }

Check failure on line 17 in spec/support/validate_hash.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

augeasproviders::instances apache_directive instances when ::augeasproviders_apache_directive_hash => 'FOO' is expected to raise Puppet::Error with message matching /expects a Hash value, got String/ Failure/Error: it { expect { is_expected.to create_class('augeasproviders') }.to raise_error(Puppet::Error, %r{expects a Hash value, got String}) } expected Puppet::Error with message matching /expects a Hash value, got String/, got #<RSpec::Expectations::ExpectationNotMetError: expected that the catalogue would contain Class[augeasproviders]> with backtrace: # ./spec/support/validate_hash.rb:17:in `block (4 levels) in <top (required)>' # ./spec/support/validate_hash.rb:17:in `block (3 levels) in <top (required)>' Shared Example Group: "validate_hash top-scope param" called from ./spec/classes/augeasproviders_instances_spec.rb:36

Check failure on line 17 in spec/support/validate_hash.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

augeasproviders::instances apache_setenv instances when ::augeasproviders_apache_setenv_hash => 'FOO' is expected to raise Puppet::Error with message matching /expects a Hash value, got String/ Failure/Error: it { expect { is_expected.to create_class('augeasproviders') }.to raise_error(Puppet::Error, %r{expects a Hash value, got String}) } expected Puppet::Error with message matching /expects a Hash value, got String/, got #<RSpec::Expectations::ExpectationNotMetError: expected that the catalogue would contain Class[augeasproviders]> with backtrace: # ./spec/support/validate_hash.rb:17:in `block (4 levels) in <top (required)>' # ./spec/support/validate_hash.rb:17:in `block (3 levels) in <top (required)>' Shared Example Group: "validate_hash top-scope param" called from ./spec/classes/augeasproviders_instances_spec.rb:36
end
end

0 comments on commit 32b6200

Please sign in to comment.