Skip to content

Commit

Permalink
Create LogSpec.groovy
Browse files Browse the repository at this point in the history
  • Loading branch information
hjwilli committed May 20, 2020
1 parent 5147c5f commit 3e67a88
Showing 1 changed file with 67 additions and 0 deletions.
67 changes: 67 additions & 0 deletions app/carnival-util/src/test/groovy/carnival/util/LogSpec.groovy
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
}

}

0 comments on commit 3e67a88

Please sign in to comment.