test/config/deploy.rb in capistrano-maven-0.1.1 vs test/config/deploy.rb in capistrano-maven-0.1.2
- old
+ new
@@ -97,10 +97,32 @@
run("rm -rf #{mvn_target_path.dump}")
run_locally("rm -rf #{mvn_target_path_local.dump}")
reset_mvn!
end
+def _test_mvn_exec_fails(args=[], options={})
+ failed = false
+ begin
+ mvn.exec(args, options)
+ rescue
+ failed = true
+ ensure
+ abort unless failed
+ end
+end
+
+def _test_mvn_exec_locally_fails(args=[], options={})
+ failed = false
+ begin
+ mvn.exec_locally(args, options)
+ rescue
+ failed = true
+ ensure
+ abort unless failed
+ end
+end
+
task(:test_all) {
find_and_execute_task("test_default")
find_and_execute_task("test_with_remote")
find_and_execute_task("test_with_local")
find_and_execute_task("test_with_release_build")
@@ -161,14 +183,22 @@
task(:test_mvn_exec) {
mvn.exec("--version")
}
+ task(:test_mvn_exec_fails) {
+ _test_mvn_exec_fails("--MUST-FAIL")
+ }
+
task(:test_mvn_exec_locally) {
mvn.exec_locally("--version")
}
+ task(:test_mvn_exec_locally_fails) {
+ _test_mvn_exec_locally_fails("--MUST-FAIL")
+ }
+
task(:test_mvn_artifact) {
assert_file_exists(File.join(mvn_target_path, "capistrano-maven-0.0.1-SNAPSHOT.jar"))
}
task(:test_mvn_artifact_locally) {
@@ -227,14 +257,22 @@
task(:test_mvn_exec) {
mvn.exec("--version")
}
+ task(:test_mvn_exec_fails) {
+ _test_mvn_exec_fails("--MUST-FAIL")
+ }
+
# task(:test_mvn_exec_locally) {
# mvn.exec_locally("--version")
# }
+# task(:test_mvn_exec_locally_fails) {
+# _test_mvn_exec_locally_fails("--MUST-FAIL")
+# }
+
task(:test_mvn_artifact) {
assert_file_exists(File.join(mvn_target_path, "capistrano-maven-0.0.1-SNAPSHOT.jar"))
}
task(:test_mvn_artifact_locally) {
@@ -293,11 +331,19 @@
# task(:test_mvn_exec) {
# mvn.exec("--version")
# }
+# task(:test_mvn_exec_fails) {
+# _test_mvn_exec_fails("--MUST-FAIL")
+# }
+
task(:test_mvn_exec_locally) {
mvn.exec_locally("--version")
+ }
+
+ task(:test_mvn_exec_locally_fails) {
+ _test_mvn_exec_locally_fails("--MUST-FAIL")
}
task(:test_mvn_artifact) {
assert_file_exists(File.join(mvn_target_path, "capistrano-maven-0.0.1-SNAPSHOT.jar"))
}