inspec/test/unit/resources/cran_test.rb
Miah Johnson 659b4b373a Remove # encoding: utf8 magic comments
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-05-07 16:06:23 -07:00

22 lines
703 B
Ruby

# author: Christoph Hartmann
# author: Dominik Richter
# author: Markus Grobelin
require 'helper'
require 'inspec/resource'
describe 'Inspec::Resources::Cran' do
it 'verify cran package detail parsing' do
resource = load_resource('cran', 'DBI')
pkg = {type: 'cran', name: 'DBI', version: '0.5.1', installed: true}
_(resource.installed?).must_equal true
_(resource.info).must_equal pkg
end
it 'verify info for non-installed packages' do
resource = load_resource('cran', 'DoesNotExist')
_(resource.installed?).must_equal false
_(resource.version).must_be_nil
_(resource.info[:name]).must_equal 'DoesNotExist'
_(resource.info[:type]).must_equal 'cran'
end
end