mirror of
https://github.com/inspec/inspec
synced 2024-12-23 03:23:27 +00:00
db96ee9e85
* Prevent resources from loading if supports fail. Signed-off-by: Jared Quick <jquick@chef.io>
31 lines
890 B
Ruby
31 lines
890 B
Ruby
require 'helper'
|
|
require 'inspec/resource'
|
|
|
|
describe 'Inspec::Resources::FileSystemResource' do
|
|
describe 'when loading filesystem in linux' do
|
|
let (:resource) { load_resource('filesystem', '/') }
|
|
|
|
it 'resolves the / partition' do
|
|
_(resource.partition).must_equal '/'
|
|
end
|
|
|
|
it 'has more than 1 MB' do
|
|
_(resource.size).must_be :>=, 1
|
|
end
|
|
|
|
it 'must equal 28252316 MB' do
|
|
_(resource.size).must_equal 28252316
|
|
end
|
|
end
|
|
describe 'when loading filesystem in unsupported OS family' do
|
|
it 'fails on Windows' do
|
|
resource_fail = MockLoader.new(:windows).load_resource('filesystem', '/')
|
|
resource_fail.check_supports.must_equal false
|
|
end
|
|
|
|
it 'fails on FreeBSD (unix-like)' do
|
|
resource_fail = MockLoader.new(:freebsd10).load_resource('filesystem', '/')
|
|
resource_fail.check_supports.must_equal false
|
|
end
|
|
end
|
|
end
|