mirror of
https://github.com/inspec/inspec
synced 2024-12-23 03:23:27 +00:00
25 lines
824 B
Ruby
25 lines
824 B
Ruby
|
# author: Christoph Hartmann
|
||
|
# author: Dominik Richter
|
||
|
# author: Markus Grobelin
|
||
|
|
||
|
require 'helper'
|
||
|
require 'inspec/resource'
|
||
|
|
||
|
describe 'Inspec::Resources::Cpan' do
|
||
|
it 'verify cpan package detail parsing' do
|
||
|
resource = load_resource('cpan', 'DBD::Pg')
|
||
|
pkg = {type: 'cpan', name: 'DBD::Pg', version: '3.7.0', installed: true}
|
||
|
_(resource.installed?).must_equal true
|
||
|
_(resource.info).must_equal pkg
|
||
|
end
|
||
|
it 'verify info for non-installed packages' do
|
||
|
resource = load_resource('cpan', 'DOES::Not::Exist')
|
||
|
pkg = {type: 'cpan', name: 'DOES::Not::Exist', installed: false}
|
||
|
_(resource.installed?).must_equal false
|
||
|
_(resource.version).must_be_nil
|
||
|
_(resource.info[:name]).must_equal 'DOES::Not::Exist'
|
||
|
_(resource.info[:type]).must_equal 'cpan'
|
||
|
_(resource.info).must_equal pkg
|
||
|
end
|
||
|
end
|