diff options
author | Josh Cooper <josh@puppet.com> | 2018-06-28 14:48:40 -0700 |
---|---|---|
committer | Josh Cooper <josh@puppet.com> | 2018-06-28 14:48:40 -0700 |
commit | 527447f54f40d2eed4d52a0477f0fcc1d8b8329b (patch) | |
tree | 2dfb11615f92f6ae710c857c5f81b73a031f5ffd /spec | |
parent | a73ad49d34744021f6c4fc090b54c907201de8a2 (diff) | |
download | puppet-augeas_core-527447f54f40d2eed4d52a0477f0fcc1d8b8329b.tar.gz puppet-augeas_core-527447f54f40d2eed4d52a0477f0fcc1d8b8329b.tar.bz2 |
pdk update using 1.6.0
Diffstat (limited to 'spec')
-rw-r--r-- | spec/spec_helper.rb | 10 | ||||
-rw-r--r-- | spec/unit/provider/augeas/augeas_spec.rb | 16 |
2 files changed, 18 insertions, 8 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 2d5f003..e69d11d 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,3 +1,4 @@ + require 'puppetlabs_spec_helper/module_spec_helper' require 'rspec-puppet-facts' @@ -33,3 +34,12 @@ RSpec.configure do |c| Puppet.settings[:strict] = :warning end end + +def ensure_module_defined(module_name) + module_name.split('::').reduce(Object) do |last_module, next_module| + last_module.const_set(next_module, Module.new) unless last_module.const_defined?(next_module) + last_module.const_get(next_module) + end +end + +# 'spec_overrides' from sync.yml will appear below this line diff --git a/spec/unit/provider/augeas/augeas_spec.rb b/spec/unit/provider/augeas/augeas_spec.rb index 46bf161..6166140 100644 --- a/spec/unit/provider/augeas/augeas_spec.rb +++ b/spec/unit/provider/augeas/augeas_spec.rb @@ -230,7 +230,7 @@ describe Puppet::Type.type(:augeas).provider(:augeas) do end describe 'values filters' do - let(:augeas) { stub('augeas', match: %w[set of values]) } + let(:augeas) { stub('augeas', match: ['set', 'of', 'values']) } before(:each) do augeas.stubs(:get).returns('set').then.returns('of').then.returns('values') @@ -280,7 +280,7 @@ describe Puppet::Type.type(:augeas).provider(:augeas) do end describe 'match filters' do - let(:augeas) { stub('augeas', match: %w[set of values]) } + let(:augeas) { stub('augeas', match: ['set', 'of', 'values']) } before(:each) do augeas.stubs('close') @@ -351,7 +351,7 @@ describe Puppet::Type.type(:augeas).provider(:augeas) do end it 'handles no filters' do - augeas.stubs('match').returns(%w[set of values]) + augeas.stubs('match').returns(['set', 'of', 'values']) expect(provider.need_to_run?).to eq(true) end @@ -424,13 +424,13 @@ describe Puppet::Type.type(:augeas).provider(:augeas) do it 'returns true when a match filter matches' do resource[:onlyif] = 'match path size == 3' - augeas.stubs('match').returns(%w[set of values]) + augeas.stubs('match').returns(['set', 'of', 'values']) expect(provider.need_to_run?).to eq(true) end it 'returns false when a match filter does not match' do resource[:onlyif] = 'match path size == 2' - augeas.stubs('match').returns(%w[set of values]) + augeas.stubs('match').returns(['set', 'of', 'values']) expect(provider.need_to_run?).to eq(false) end @@ -438,21 +438,21 @@ describe Puppet::Type.type(:augeas).provider(:augeas) do it 'setting force should not change the above logic' do resource[:force] = true resource[:onlyif] = 'match path size == 2' - augeas.stubs('match').returns(%w[set of values]) + augeas.stubs('match').returns(['set', 'of', 'values']) expect(provider.need_to_run?).to eq(false) end # Ticket 5211 testing it 'returns true when a size != the provided value' do resource[:onlyif] = 'match path size != 17' - augeas.stubs('match').returns(%w[set of values]) + augeas.stubs('match').returns(['set', 'of', 'values']) expect(provider.need_to_run?).to eq(true) end # Ticket 5211 testing it 'returns false when a size does equal the provided value' do resource[:onlyif] = 'match path size != 3' - augeas.stubs('match').returns(%w[set of values]) + augeas.stubs('match').returns(['set', 'of', 'values']) expect(provider.need_to_run?).to eq(false) end |