diff options
author | Helen <helen@puppetlabs.com> | 2016-04-15 13:29:23 +0100 |
---|---|---|
committer | Helen <helen@puppetlabs.com> | 2016-04-15 13:29:23 +0100 |
commit | d9f65387c99c99177f94075fc840e7c574e07417 (patch) | |
tree | e2b1bf7362973650efdcac0a3be68df7d9bae8f6 /spec/unit | |
parent | 29961218a74bfdae96371c42a3c336e714c79a93 (diff) | |
parent | 085035dccebbf27cf2bfd7f1d9101c746f5178a2 (diff) |
Merge pull request #595 from tphoney/4.12.0_release
master to 4.12.x
Diffstat (limited to 'spec/unit')
-rwxr-xr-x | spec/unit/puppet/provider/file_line/ruby_spec.rb | 4 | ||||
-rwxr-xr-x | spec/unit/puppet/type/file_line_spec.rb | 7 |
2 files changed, 7 insertions, 4 deletions
diff --git a/spec/unit/puppet/provider/file_line/ruby_spec.rb b/spec/unit/puppet/provider/file_line/ruby_spec.rb index 23e649c..fdeaf1a 100755 --- a/spec/unit/puppet/provider/file_line/ruby_spec.rb +++ b/spec/unit/puppet/provider/file_line/ruby_spec.rb @@ -398,7 +398,7 @@ describe provider_class do expect(File.read(@tmpfile)).to eql("foo1\nfoo2\n") end - it 'should ignore the match if match_for_absense is not specified' do + it 'should ignore the match if match_for_absence is not specified' do @resource = Puppet::Type::File_line.new( { :name => 'foo', @@ -416,7 +416,7 @@ describe provider_class do expect(File.read(@tmpfile)).to eql("foo1\nfoo\n") end - it 'should ignore the match if match_for_absense is false' do + it 'should ignore the match if match_for_absence is false' do @resource = Puppet::Type::File_line.new( { :name => 'foo', diff --git a/spec/unit/puppet/type/file_line_spec.rb b/spec/unit/puppet/type/file_line_spec.rb index f1430f2..48e2670 100755 --- a/spec/unit/puppet/type/file_line_spec.rb +++ b/spec/unit/puppet/type/file_line_spec.rb @@ -41,10 +41,13 @@ describe Puppet::Type.type(:file_line) do expect { file_line[:path] = 'file' }.to raise_error(Puppet::Error, /File paths must be fully qualified/) end it 'should require that a line is specified' do - expect { Puppet::Type.type(:file_line).new(:name => 'foo', :path => '/tmp/file') }.to raise_error(Puppet::Error, /Both line and path are required attributes/) + expect { Puppet::Type.type(:file_line).new(:name => 'foo', :path => '/tmp/file') }.to raise_error(Puppet::Error, /line is a required attribute/) + end + it 'should not require that a line is specified when matching for absence' do + expect { Puppet::Type.type(:file_line).new(:name => 'foo', :path => '/tmp/file', :ensure => :absent, :match_for_absence => :true, :match => 'match') }.not_to raise_error end it 'should require that a file is specified' do - expect { Puppet::Type.type(:file_line).new(:name => 'foo', :line => 'path') }.to raise_error(Puppet::Error, /Both line and path are required attributes/) + expect { Puppet::Type.type(:file_line).new(:name => 'foo', :line => 'path') }.to raise_error(Puppet::Error, /path is a required attribute/) end it 'should default to ensure => present' do expect(file_line[:ensure]).to eq :present |