tests/test.sh in metadata-json-lint-1.2.1 vs tests/test.sh in metadata-json-lint-1.2.2
- old
+ new
@@ -64,11 +64,11 @@
local expect=$1; shift
local rake_task="${1-metadata_lint}"
local RESULT=-1;
cd $name;
- bundle exec rake $rake_task >/dev/null 2>&1
+ bundle exec rake $rake_task >last_rake_output 2>&1
RESULT=$?
if [ $RESULT -ne $expect ]; then
fail "Failing Test '${name}' (rake: ${rake_task})"
else
echo "Successful Test '${name}' (rake: ${rake_task})"
@@ -96,12 +96,14 @@
# Run with --no-fail-on-warnings, expect SUCCESS
test "duplicate-dep" $SUCCESS --no-fail-on-warnings
# Run a broken one, expect FAILURE
test "bad_license" $FAILURE
-# Run with --no-strict-license, expect SUCCESS
-test "bad_license" $SUCCESS --no-strict-license --no-fail-on-warnings
+# Run with --no-strict-license only, expect SUCCESS
+test "bad_license" $SUCCESS --no-strict-license
+# Run with --no-fail-on-warnings, expect SUCCESS
+test "bad_license" $SUCCESS --no-fail-on-warnings
# Run a broken one, expect FAILURE
test "long_summary" $FAILURE
# Run a broken one, expect FAILURE
@@ -151,7 +153,13 @@
test_bin "rake_global_options" $FAILURE
test_rake "rake_global_options" $SUCCESS
# Test multiple lints with different options
test_rake "rake_multiple_json_options" $SUCCESS metadata_lint_multi
+
+# Test successful lint followed by further tasks
+test_rake "rake_chaining" $SUCCESS test
+if ! grep -qx "Successfully linted" rake_chaining/last_rake_output; then
+ fail "Failing Test 'rake_chaining' failed to run second rake task"
+fi
exit $STATUS