Sha256: e5f05c178ee92905ed5759f85269f5e4b9458013a93954724a9d57eaaeb6a728
Contents?: true
Size: 1.25 KB
Versions: 16
Compression:
Stored size: 1.25 KB
Contents
test_name 'use the init subcommand' do SubcommandUtil = Beaker::Subcommands::SubcommandUtil def delete_root_folder_contents on default, 'rm -rf /root/* /root/.beaker' end step 'ensure beaker init requires hosts flag' do result = on(default, 'beaker init') assert_match(/No value(.+)--hosts/, result.raw_output) end step 'ensure beaker init writes YAML configuration files to disk' do delete_root_folder_contents on(default, 'beaker init --hosts centos6-64') subcommand_options = on(default, "cat #{SubcommandUtil::SUBCOMMAND_OPTIONS}").stdout subcommand_state = on(default, "cat #{SubcommandUtil::SUBCOMMAND_STATE}").stdout parsed_options = YAML.parse(subcommand_options).to_ruby assert(parsed_options["HOSTS"].count == 1) assert(parsed_options.instance_of?(Hash)) assert(YAML.parse(subcommand_state).to_ruby.instance_of?(Hash)) end step 'ensure beaker init saves beaker-run arguments to the subcommand_options.yaml' do delete_root_folder_contents on(default, 'beaker init --log-level verbose --hosts centos6-64') subcommand_options = on(default, "cat #{SubcommandUtil::SUBCOMMAND_OPTIONS}").stdout hash = YAML.parse(subcommand_options).to_ruby assert_equal('verbose', hash['log_level']) end end
Version data entries
16 entries across 16 versions & 1 rubygems