Commits

Meikel Brandmeyer committed 87a5dcc

Switch from exceptions to SKIP for missing configuration

  • Participants
  • Parent commits cc622e6

Comments (0)

Files changed (2)

File src/main/groovy/clojuresque/ClojarsExtension.groovy

             if (p.hasProperty("clojuresque.clojars.username")) {
                 username = p["clojuresque.clojars.username"]
             } else {
-                throw new InvalidUserDataException("Clojars user name missing!")
+                upload.enabled = false
+                return
             }
         }
 
             if (p.hasProperty("clojuresque.clojars.password")) {
                 password = p["clojuresque.clojars.password"]
             } else {
-                throw new InvalidUserDataException("Clojars password missing!")
+                upload.enabled = false
+                return
             }
         }
 

File src/test/groovy/clojuresque/ClojarsExtensionTest.groovy

     def "deploy with empty user name fails"() {
         when:
         def upload = project.tasks.add(name: "upload", type: Upload)
+        upload.enabled = true
         project.clojars {
             password = "password"
             deploy(upload)
         }
 
         then:
-        thrown(InvalidUserDataException)
+        upload.enabled == false
     }
 
     def "deploy with empty password fails"() {
         when:
         def upload = project.tasks.add(name: "upload", type: Upload)
+        upload.enabled = true
         project.clojars {
             username = "user"
             deploy(upload)
         }
 
         then:
-        thrown(InvalidUserDataException)
+        upload.enabled == false
     }
 
     def "deploy with empty URL uses the default"() {