forked from typesafehub/sbt-conductr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
+ improves conductr url setting from the console, and smater default
Resolves typesafehub#44 typesafehub#46
- Loading branch information
Showing
4 changed files
with
74 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
src/test/scala/com/typesafe/conductr/sbt/SbtTypesafeConductRSpec.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright © 2014 Typesafe, Inc. All rights reserved. | ||
*/ | ||
|
||
package com.typesafe.conductr.sbt | ||
|
||
import akka.actor.ActorSystem | ||
import org.scalatest.{ BeforeAndAfterAll, Matchers, PrivateMethodTester, WordSpec } | ||
|
||
class SbtTypesafeConductRSpec extends WordSpec with Matchers with BeforeAndAfterAll with PrivateMethodTester { | ||
|
||
"Setting ConductR URL" should { | ||
"be prepared to full format given partial input" in { | ||
val inputToUrls = Map( | ||
"192.1.1.28" -> "http://192.1.1.28:9005", | ||
"http://192.1.1.28" -> "http://192.1.1.28:9005", | ||
"http://192.1.1.28/my/example" -> "http://192.1.1.28:9005/my/example", | ||
"http://192.1.1.28/my/example/" -> "http://192.1.1.28:9005/my/example/", | ||
"http://192.1.1.28/example" -> "http://192.1.1.28:9005/example", | ||
"http://192.1.1.28/example/" -> "http://192.1.1.28:9005/example/", | ||
"http://192.1.1.28:9999" -> "http://192.1.1.28:9999", | ||
"http://192.1.1.28:9999/example" -> "http://192.1.1.28:9999/example" | ||
) | ||
|
||
val prepareUrl = PrivateMethod[sbt.URL]('prepareUrl) | ||
inputToUrls foreach { | ||
case (input, fullUrl) => SbtTypesafeConductR.invokePrivate(prepareUrl(input)).toString shouldBe fullUrl | ||
} | ||
} | ||
} | ||
|
||
private implicit val system = | ||
ActorSystem() | ||
|
||
override protected def afterAll(): Unit = { | ||
system.shutdown() | ||
system.awaitTermination() | ||
} | ||
|
||
} |