mirror of
https://github.com/inspec/inspec
synced 2024-11-23 21:23:29 +00:00
adaf2bc364
This speeds up parallel unit test runs from a very consistent 2:49 to a very consistent 1:53, or a 33% reduction. Signed-off-by: Ryan Davis <zenspider@chef.io>
25 lines
693 B
Ruby
25 lines
693 B
Ruby
|
|
require 'helper'
|
|
|
|
describe Inspec::Resources::Ksh do
|
|
let(:x) { rand.to_s }
|
|
let(:resource) { load_resource('ksh', '$("'+x+'")') }
|
|
|
|
it 'prints as a ksh command' do
|
|
resource.to_s.must_equal 'KornShell command $("'+x+'")'
|
|
end
|
|
|
|
it 'wraps the command' do
|
|
resource.command.must_equal "ksh -c \\$\\(\\\"#{x}\\\"\\)"
|
|
end
|
|
|
|
it 'can specify an executable path' do
|
|
resource = load_resource('ksh', '$("'+x+'")', path: '/bin/ksh')
|
|
resource.command.must_equal "/bin/ksh -c \\$\\(\\\"#{x}\\\"\\)"
|
|
end
|
|
|
|
it 'can specify a arguments' do
|
|
resource = load_resource('ksh', '$("'+x+'")', args: '-x -c')
|
|
resource.command.must_equal "ksh -x -c \\$\\(\\\"#{x}\\\"\\)"
|
|
end
|
|
end
|