diff options
Diffstat (limited to 'spec/acceptance/tests/ticket_4131_should_not_create_without_ip.rb')
-rw-r--r-- | spec/acceptance/tests/ticket_4131_should_not_create_without_ip.rb | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/spec/acceptance/tests/ticket_4131_should_not_create_without_ip.rb b/spec/acceptance/tests/ticket_4131_should_not_create_without_ip.rb index 867ff6c..a26faee 100644 --- a/spec/acceptance/tests/ticket_4131_should_not_create_without_ip.rb +++ b/spec/acceptance/tests/ticket_4131_should_not_create_without_ip.rb @@ -1,29 +1,31 @@ -test_name "#4131: should not create host without IP attribute" +test_name '#4131: should not create host without IP attribute' tag 'audit:low', 'audit:refactor', # Use block style `test_name` 'audit:acceptance' # Could be done at the integration (or unit) layer though - # actual changing of resources could irreparably damage a - # host running this, or require special permissions. +# actual changing of resources could irreparably damage a +# host running this, or require special permissions. agents.each do |agent| file = agent.tmpfile('4131-require-ip') - step "configure the target system for the test" + step 'configure the target system for the test' on agent, "rm -rf #{file} ; touch #{file}" - step "try to create the host, which should fail" + step 'try to create the host, which should fail' # REVISIT: This step should properly need to handle the non-zero exit code, # and #5668 has been filed to record that. When it is fixed this test will # start to fail, and this comment will tell you why. --daniel 2010-12-24 on(agent, puppet_resource('host', 'test', "target=#{file}", - "host_aliases=alias")) do - fail_test "puppet didn't complain about the missing attribute" unless - stderr.include? 'ip is a required attribute for hosts' unless agent['locale'] == 'ja' + 'host_aliases=alias')) do + unless agent['locale'] == 'ja' + fail_test "puppet didn't complain about the missing attribute" unless + stderr.include? 'ip is a required attribute for hosts' + end end - step "verify that the host was not added to the file" + step 'verify that the host was not added to the file' on(agent, "cat #{file} ; rm -f #{file}") do - fail_test "the host was apparently added to the file" if stdout.include? 'test' + fail_test 'the host was apparently added to the file' if stdout.include? 'test' end end |