mirror of
https://github.com/inspec/inspec
synced 2024-11-27 07:00:39 +00:00
a084187b21
profile name. eg "with/slash" would result in a profile created in the "with" directory named "slash" Add test for inspec init, and updated other for new output. Clean up profiles created during testing and place them in temporary directories. Describe our test a bit better. Check that the profile was created in the right location. Check that the profile is named correctly. Signed-off-by: Miah Johnson <miah@chia-pet.org>
23 lines
650 B
Ruby
23 lines
650 B
Ruby
require 'functional/helper'
|
|
require 'fileutils'
|
|
require 'tmpdir'
|
|
require 'yaml'
|
|
|
|
describe 'inspec init' do
|
|
include FunctionalHelper
|
|
|
|
tmpdir = Dir.tmpdir
|
|
|
|
describe 'inspec init profile with/slash' do
|
|
it 'names profile with string after last slash' do
|
|
slash_profile = "#{tmpdir}/inspecwith/slash"
|
|
out = inspec("init profile #{slash_profile}")
|
|
out.exit_status.must_equal 0
|
|
File.exist?(slash_profile).must_equal true
|
|
profile = YAML.load_file("#{slash_profile}/inspec.yml")
|
|
profile['name'].must_equal 'slash'
|
|
end
|
|
end
|
|
|
|
Dir.glob("#{tmpdir}/inspecwith*").each {|i| FileUtils.remove_entry_secure(i) }
|
|
end
|