Skip to content

Commit

Permalink
(maint) - Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanbreen28 committed Oct 2, 2023
1 parent a3008f0 commit 92b2bbf
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
1 change: 0 additions & 1 deletion lib/rspec-puppet/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

RSpec.configure do |c|
c.module_path = File.join(fixture_path, 'modules')
c.manifest_dir = File.join(fixture_path, 'manifests')
c.manifest = File.join(fixture_path, 'manifests', 'site.pp')
c.environmentpath = File.join(Dir.pwd, 'spec')
end
1 change: 0 additions & 1 deletion spec/classes/server_facts_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@
it { is_expected.to contain_notify('serverip-192.168.1.10') }

Check failure on line 16 in spec/classes/server_facts_spec.rb

View workflow job for this annotation

GitHub Actions / spec (ubuntu-latest ruby 2.7 | puppet ~> 7.0) / spec

Layout/IndentationConsistency: Inconsistent indentation detected.

Check failure on line 16 in spec/classes/server_facts_spec.rb

View workflow job for this annotation

GitHub Actions / spec (ubuntu-latest ruby 3.2 | puppet https://github.com/puppetlabs/puppet) / spec

Layout/IndentationConsistency: Inconsistent indentation detected.
it { is_expected.to contain_notify("serverversion-#{Puppet.version}") }

Check failure on line 17 in spec/classes/server_facts_spec.rb

View workflow job for this annotation

GitHub Actions / spec (ubuntu-latest ruby 2.7 | puppet ~> 7.0) / spec

Layout/IndentationConsistency: Inconsistent indentation detected.

Check failure on line 17 in spec/classes/server_facts_spec.rb

View workflow job for this annotation

GitHub Actions / spec (ubuntu-latest ruby 3.2 | puppet https://github.com/puppetlabs/puppet) / spec

Layout/IndentationConsistency: Inconsistent indentation detected.
it { is_expected.to contain_notify('environment-rp_env') }

Check failure on line 18 in spec/classes/server_facts_spec.rb

View workflow job for this annotation

GitHub Actions / spec (ubuntu-latest ruby 2.7 | puppet ~> 7.0) / spec

Layout/IndentationConsistency: Inconsistent indentation detected.

Check failure on line 18 in spec/classes/server_facts_spec.rb

View workflow job for this annotation

GitHub Actions / spec (ubuntu-latest ruby 3.2 | puppet https://github.com/puppetlabs/puppet) / spec

Layout/IndentationConsistency: Inconsistent indentation detected.
end
end
19 changes: 19 additions & 0 deletions spec/unit/adapters_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,25 @@ def context_double(options = {})
end
end

it 'sets Puppet[:strict_variables] to false by default' do
subject.setup_puppet(context_double)
# strict variables enabled by default in puppet 8.x +
setting = Puppet::Util::Package.versioncmp(Puppet.version, '8.0.0') >= 0
expect(Puppet[:strict_variables]).to be(setting)
end

it 'reads the :strict_variables setting' do
context = context_double strict_variables: true
subject.setup_puppet(context)
expect(Puppet[:strict_variables]).to be(true)
end

it 'overrides the environmentpath set by Puppet::Test::TestHelper' do
context = context_double environmentpath: '/path/to/my/environments'
subject.setup_puppet(context)
expect(Puppet[:environmentpath]).to match(%r{(C:)?/path/to/my/environments})
end

describe '#set_setting' do
describe 'with a context specific setting' do
it 'sets the Puppet setting based on the example group setting' do
Expand Down

0 comments on commit 92b2bbf

Please sign in to comment.