Skip to content

Commit

Permalink
Add aggregation test case for embedded config
Browse files Browse the repository at this point in the history
  • Loading branch information
jonas committed Sep 13, 2016
1 parent 285b5ee commit 4056a7c
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
12 changes: 12 additions & 0 deletions plugin/src/sbt-test/paradox/snippets/expected/multiple.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,15 @@
<pre class="prettyprint"><code class="language-scala">import scala.util.Try

def parseInt(s: String): Option[Int] = Try(s.toInt).toOption</code></pre>
<pre class="prettyprint"><code class="language-conf"># HTTP Configuration
http {
port=80
host=0.0.0.0
}

# Database Configuration
db {
url=jdbc:mysql://mydb/mytable
user=dev
pass=secret
}</code></pre>
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@@ snip [multiple snippet](../../test/scala/Multiple.scala) { #multiple }

@@ snip [comma separated snippet](../../test/scala/Multiple.scala) { #parseint-imports #parseint-def }
@@ snip [multi-label snippet](../../test/scala/Multiple.scala) { #parseint-imports #parseint-def }

@@ snip [multi-label conf snippet](../../test/scala/Multiple.scala) { #http-config #db-config type=conf }
21 changes: 21 additions & 0 deletions plugin/src/sbt-test/paradox/snippets/src/test/scala/Multiple.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,25 @@ object Multiple {

def parseInt(s: String): Option[Int] = Try(s.toInt).toOption
// #parseint-def

val config = """
#http-config
# HTTP Configuration
http {
port=80
host=0.0.0.0
}
#http-config
http.port=${?HTTP_PORT}
#db-config
# Database Configuration
db {
url=jdbc:mysql://mydb/mytable
user=dev
pass=secret
}
#db-config
"""
}

0 comments on commit 4056a7c

Please sign in to comment.