Skip to content

Commit

Permalink
Check for stout, stderr along with status code
Browse files Browse the repository at this point in the history
  • Loading branch information
Chirag Jog committed Jan 21, 2013
1 parent 90c7c80 commit 6063249
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions lib/knife_cloud_tests/helper.rb
Expand Up @@ -41,14 +41,13 @@ def find_id(instance_name, line)
end
end

def match_status(test_run_expect)
if "#{test_run_expect}" == "should fail"
def match_status(expect_params)
expected_status = expect_params[:status]
expected_stdout = expect_params[:stdout]
expected_stderr = expect_params[:stderr]
if "#{expected_status}" == "should fail"
should_not have_outcome :status => 0
elsif "#{test_run_expect}" == "should succeed"
should have_outcome :status => 0
elsif "#{test_run_expect}" == "should return empty list"
should have_outcome :status => 0
else
should have_outcome :status => 0
elsif "#{expected_status}" == "should succeed" or "#{expected_status}" == "should return empty list"
should have_outcome :status => 0, :stdout => /#{expected_stdout}/, :stderr => /#{expected_stderr}/
end
end

0 comments on commit 6063249

Please sign in to comment.