mirror of
https://github.com/inspec/inspec
synced 2024-11-27 15:10:44 +00:00
24 lines
650 B
Ruby
24 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
|