Merge pull request #262 from cyberious/master
Fix Solaris 10 errors in tests and more issues with Windows checks of owner
This commit is contained in:
commit
bccd7ed992
3 changed files with 17 additions and 14 deletions
|
@ -33,7 +33,7 @@ describe 'concat backup parameter' do
|
|||
|
||||
describe file("#{basedir}/file") do
|
||||
it { should be_file }
|
||||
it { should contain 'new contents' }
|
||||
its(:content) { should match /new contents/ }
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -68,11 +68,11 @@ describe 'concat backup parameter' do
|
|||
|
||||
describe file("#{basedir}/file") do
|
||||
it { should be_file }
|
||||
it { should contain 'new contents' }
|
||||
its(:content) { should match /new contents/ }
|
||||
end
|
||||
describe file("#{basedir}/file.backup") do
|
||||
it { should be_file }
|
||||
it { should contain 'old contents' }
|
||||
its(:content) { should match /old contents/ }
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -109,7 +109,7 @@ describe 'concat backup parameter' do
|
|||
|
||||
describe file("#{basedir}/file") do
|
||||
it { should be_file }
|
||||
it { should contain 'new contents' }
|
||||
its(:content) { should match /new contents/ }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -2,7 +2,8 @@ class Specinfra::Command::Windows::Base::File < Specinfra::Command::Windows::Bas
|
|||
class << self
|
||||
def check_is_owned_by(file, owner)
|
||||
Backend::PowerShell::Command.new do
|
||||
exec "((gci '#{file}').GetAccessControl().Owner -match '#{owner}').Length -gt 0"
|
||||
exec "if((Get-Item '#{file}').GetAccessControl().Owner -match '#{owner}'
|
||||
-or ((Get-Item '#{file}').GetAccessControl().Owner -match '#{owner}').Length -gt 0){ exit 0 } else { exit 1 }"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -29,9 +29,9 @@ describe 'concat warn =>' do
|
|||
describe file("#{basedir}/file") do
|
||||
it { should be_file }
|
||||
its(:content) {
|
||||
should match '# This file is managed by Puppet. DO NOT EDIT.'
|
||||
should match '1'
|
||||
should match '2'
|
||||
should match /# This file is managed by Puppet\. DO NOT EDIT\./
|
||||
should match /1/
|
||||
should match /2/
|
||||
}
|
||||
end
|
||||
end
|
||||
|
@ -61,9 +61,11 @@ describe 'concat warn =>' do
|
|||
|
||||
describe file("#{basedir}/file") do
|
||||
it { should be_file }
|
||||
it { should_not contain '# This file is managed by Puppet. DO NOT EDIT.' }
|
||||
it { should contain '1' }
|
||||
it { should contain '2' }
|
||||
its(:content) {
|
||||
should_not match /# This file is managed by Puppet\. DO NOT EDIT\./
|
||||
should match /1/
|
||||
should match /2/
|
||||
}
|
||||
end
|
||||
end
|
||||
context '# foo should overide default warning message' do
|
||||
|
@ -93,9 +95,9 @@ describe 'concat warn =>' do
|
|||
describe file("#{basedir}/file") do
|
||||
it { should be_file }
|
||||
its(:content) {
|
||||
should match '# foo'
|
||||
should match '1'
|
||||
should match '2'
|
||||
should match /# foo/
|
||||
should match /1/
|
||||
should match /2/
|
||||
}
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue