2018-02-28 19:22:55 +00:00
|
|
|
# encoding: utf-8
|
|
|
|
|
|
|
|
require 'helper'
|
|
|
|
require 'inspec/resource'
|
|
|
|
|
|
|
|
describe 'Inspec::Resources::Virtualization' do
|
|
|
|
let(:resource) { MockLoader.new(:ubuntu).load_resource('virtualization') }
|
|
|
|
|
2018-07-19 12:16:54 +00:00
|
|
|
it 'fails the resource if OS is not Linux' do
|
2018-02-28 19:22:55 +00:00
|
|
|
resource = MockLoader.new(:windows).load_resource('virtualization')
|
2018-07-19 12:16:54 +00:00
|
|
|
resource.resource_failed?.must_equal true
|
2018-02-28 19:22:55 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'returns nil for all properties if no virutalization platform is found' do
|
|
|
|
resource.system.must_be_nil
|
|
|
|
resource.role.must_be_nil
|
|
|
|
end
|
|
|
|
end
|