2018-01-25 14:29:31 +00:00
|
|
|
require 'helper'
|
|
|
|
require 'inspec/resource'
|
|
|
|
|
|
|
|
describe 'Inspec::Resources::FileSystemResource' do
|
2018-11-19 18:32:59 +00:00
|
|
|
# arch linux
|
|
|
|
it 'verify filesystem on linux' do
|
|
|
|
resource = MockLoader.new(:ubuntu1404).load_resource('filesystem','/')
|
|
|
|
_(resource.size).must_be :>=, 1
|
|
|
|
_(resource.name).must_equal '/'
|
|
|
|
end
|
|
|
|
|
|
|
|
# arch windows
|
|
|
|
it 'verify filesystem on windows' do
|
|
|
|
resource = MockLoader.new(:windows).load_resource('filesystem','c:')
|
|
|
|
_(resource.size).must_be :>=, 1
|
|
|
|
_(resource.name).must_equal 'c:'
|
2018-01-25 14:29:31 +00:00
|
|
|
end
|
|
|
|
|
2018-11-19 18:32:59 +00:00
|
|
|
# unsuported os
|
|
|
|
describe 'when loading filesystem in unsupported OS family' do
|
2018-01-25 14:29:31 +00:00
|
|
|
it 'fails on FreeBSD (unix-like)' do
|
|
|
|
resource_fail = MockLoader.new(:freebsd10).load_resource('filesystem', '/')
|
2018-02-16 20:15:53 +00:00
|
|
|
resource_fail.check_supports.must_equal false
|
2018-01-25 14:29:31 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|