From bc727a7a620b1885391d674d6ffbf96df7231a9e Mon Sep 17 00:00:00 2001 From: Morgan Haskel Date: Fri, 3 Oct 2014 15:01:20 -0400 Subject: [PATCH] Don't test mode and symlinks on windows --- spec/acceptance/concat_spec.rb | 22 ++++++++++---------- spec/acceptance/deprecation_warnings_spec.rb | 5 ++--- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/spec/acceptance/concat_spec.rb b/spec/acceptance/concat_spec.rb index 10f72d9..d9d835e 100644 --- a/spec/acceptance/concat_spec.rb +++ b/spec/acceptance/concat_spec.rb @@ -42,49 +42,49 @@ describe 'basic concat test' do describe file("#{vardir}/concat") do it { should be_directory } it { should be_owned_by username } - it("should be mode", :unless => (fact('osfamily') == 'AIX')) { + it("should be mode", :unless => (fact('osfamily') == 'AIX') or fact('osfamily') == 'windows') { should be_mode 755 } end describe file("#{vardir}/concat/bin") do it { should be_directory } it { should be_owned_by username } - it("should be mode", :unless => (fact('osfamily') == 'AIX')) { + it("should be mode", :unless => (fact('osfamily') == 'AIX') or fact('osfamily') == 'windows') { should be_mode 755 } end describe file("#{vardir}/concat/bin/#{scriptname}") do it { should be_file } it { should be_owned_by username } - it("should be mode", :unless => (fact('osfamily') == 'AIX')) { + it("should be mode", :unless => (fact('osfamily') == 'AIX') or fact('osfamily') == 'windows') { should be_mode 755 } end describe file("#{vardir}/concat/#{safe_basedir}_file") do it { should be_directory } it { should be_owned_by username } - it("should be mode", :unless => (fact('osfamily') == 'AIX')) { + it("should be mode", :unless => (fact('osfamily') == 'AIX') or fact('osfamily') == 'windows') { should be_mode 750 } end describe file("#{vardir}/concat/#{safe_basedir}_file/fragments") do it { should be_directory } it { should be_owned_by username } - it("should be mode", :unless => (fact('osfamily') == 'AIX')) { + it("should be mode", :unless => (fact('osfamily') == 'AIX') or fact('osfamily') == 'windows') { should be_mode 750 } end describe file("#{vardir}/concat/#{safe_basedir}_file/fragments.concat") do it { should be_file } it { should be_owned_by username } - it("should be mode", :unless => (fact('osfamily') == 'AIX')) { + it("should be mode", :unless => (fact('osfamily') == 'AIX') or fact('osfamily') == 'windows') { should be_mode 640 } end describe file("#{vardir}/concat/#{safe_basedir}_file/fragments.concat.out") do it { should be_file } it { should be_owned_by username } - it("should be mode", :unless => (fact('osfamily') == 'AIX')) { + it("should be mode", :unless => (fact('osfamily') == 'AIX') or fact('osfamily') == 'windows') { should be_mode 640 } end @@ -125,7 +125,7 @@ describe 'basic concat test' do it { should be_file } it { should be_owned_by username } it { should be_grouped_into groupname } - it("should be mode", :unless => (fact('osfamily') == 'AIX')) { + it("should be mode", :unless => (fact('osfamily') == 'AIX') or fact('osfamily') == 'windows') { should be_mode 644 } it { should contain '1' } @@ -134,14 +134,14 @@ describe 'basic concat test' do describe file("#{vardir}/concat/#{safe_basedir}_file/fragments/01_1") do it { should be_file } it { should be_owned_by username } - it("should be mode", :unless => (fact('osfamily') == 'AIX')) { + it("should be mode", :unless => (fact('osfamily') == 'AIX') or fact('osfamily') == 'windows') { should be_mode 640 } end describe file("#{vardir}/concat/#{safe_basedir}_file/fragments/02_2") do it { should be_file } it { should be_owned_by username } - it("should be mode", :unless => (fact('osfamily') == 'AIX')) { + it("should be mode", :unless => (fact('osfamily') == 'AIX') or fact('osfamily') == 'windows') { should be_mode 640 } end @@ -174,7 +174,7 @@ describe 'basic concat test' do describe file("#{basedir}/file") do it { should be_file } - it("should be mode", :unless => (fact('osfamily') == 'AIX')) { + it("should be mode", :unless => (fact('osfamily') == 'AIX') or fact('osfamily') == 'windows') { should be_mode 644 } it { should contain '1' } diff --git a/spec/acceptance/deprecation_warnings_spec.rb b/spec/acceptance/deprecation_warnings_spec.rb index 7b0f5c5..dc2f234 100644 --- a/spec/acceptance/deprecation_warnings_spec.rb +++ b/spec/acceptance/deprecation_warnings_spec.rb @@ -73,10 +73,9 @@ describe 'deprecation warnings' do end end - context 'concat::fragment ensure parameter' do + context 'concat::fragment ensure parameter', :unless => fact('osfamily') == 'windows' do context 'target file exists' do before(:all) do - shell("/bin/echo 'file1 contents' > #{basedir}/file1") pp = <<-EOS file { '#{basedir}': ensure => directory, @@ -126,7 +125,7 @@ describe 'deprecation warnings' do end end # target file exists - context 'target does not exist' do + context 'target does not exist', :unless => fact('osfamily') == 'windows' do pp = <<-EOS concat { '#{basedir}/file': } concat::fragment { 'foo':