specinfra_stubs.rb 581 B

12345678910111213141516171819
  1. class Specinfra::Command::Windows::Base::File < Specinfra::Command::Windows::Base
  2. class << self
  3. def check_is_owned_by(file, owner)
  4. Backend::PowerShell::Command.new do
  5. exec "if((Get-Item '#{file}').GetAccessControl().Owner -match '#{owner}'
  6. -or ((Get-Item '#{file}').GetAccessControl().Owner -match '#{owner}').Length -gt 0){ exit 0 } else { exit 1 }"
  7. end
  8. end
  9. end
  10. end
  11. class Specinfra::Command::Base::File < Specinfra::Command::Base
  12. class << self
  13. def get_content(file)
  14. "cat '#{file}' 2> /dev/null || echo -n"
  15. end
  16. end
  17. end