-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
67 additions
and
0 deletions.
There are no files selected for viewing
67 changes: 67 additions & 0 deletions
67
app/carnival-util/src/test/groovy/carnival/util/LogSpec.groovy
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,67 @@ | ||
package carnival.util | ||
|
||
|
||
import spock.lang.Specification | ||
import spock.lang.Unroll | ||
import spock.lang.Shared | ||
|
||
import org.slf4j.Logger | ||
import org.slf4j.LoggerFactory | ||
|
||
|
||
/** | ||
* gradle -Dtest.single=LogSpec test | ||
* | ||
* | ||
*/ | ||
class LogSpec extends Specification { | ||
|
||
|
||
// optional fixture methods | ||
/* | ||
def setup() {} // run before every feature method | ||
def cleanup() {} // run after every feature method | ||
def setupSpec() {} // run before the first feature method | ||
def cleanupSpec() {} // run after the last feature method | ||
*/ | ||
|
||
|
||
/////////////////////////////////////////////////////////////////////////// | ||
// FIELDS | ||
/////////////////////////////////////////////////////////////////////////// | ||
|
||
@Shared Logger testLog | ||
|
||
/////////////////////////////////////////////////////////////////////////// | ||
// SET UP | ||
/////////////////////////////////////////////////////////////////////////// | ||
|
||
def setupSpec() { | ||
testLog = LoggerFactory.getLogger('carnivalLogTester') | ||
} | ||
|
||
|
||
def cleanupSpec() { | ||
} | ||
|
||
|
||
|
||
|
||
def "progress method for valid params"() { | ||
//when: | ||
|
||
|
||
expect: | ||
Log.progress(testLog, msg, total, current) | ||
|
||
where: | ||
msg | total | current | ||
"test" | 10 | 5 | ||
"test" | 10 | 10 | ||
"test" | 10 | 0 | ||
"test" | 0 | 10 | ||
"test" | 0 | 0 | ||
null | 10 | 5 | ||
} | ||
|
||
} |