diff --git a/test/integration/lib.rb b/test/integration/lib.rb index 63c81e8..5d262b6 100644 --- a/test/integration/lib.rb +++ b/test/integration/lib.rb @@ -128,6 +128,15 @@ class IntegrationTest < Test::Unit::TestCase TestLib.clear_env end + # extra assertions + + def assert_success(res) + msg = build_message(nil, "command status was expected to be a success, but failed with code and STDERR:\n\n#{res.err}", res.status.to_i) + assert_block(msg) { res.status.success? } + end + + # utils + def make_project(template_dir = nil) test_name = local_name test_name = test_name[5..] if test_name.start_with?('test_') diff --git a/test/integration/test_simple.rb b/test/integration/test_simple.rb index 3a3096d..c5e4810 100644 --- a/test/integration/test_simple.rb +++ b/test/integration/test_simple.rb @@ -9,7 +9,7 @@ class Simple < IntegrationTest prj.create_lists_with package: 'CPMAddPackage("gh:cpm-cmake/testpack-adder#cad1cd4b4cdf957c5b59e30bc9a1dd200dbfc716")' cfg_result = prj.configure - assert cfg_result.status.success? + assert_success cfg_result cache = prj.read_cache @@ -29,7 +29,7 @@ class Simple < IntegrationTest prj.create_lists_with package: 'CPMAddPackage("gh:cpm-cmake/testpack-adder@1.0.0")' cfg_result = prj.configure - assert cfg_result.status.success? + assert_success cfg_result cache = prj.read_cache