Last active
December 10, 2015 09:30
-
-
Save wojtekerbetowski/4414910 to your computer and use it in GitHub Desktop.
spec
This file contains hidden or 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
class LoggingSpec extends Specification { | |
def "fake service should log a message"() { | |
given: | |
def logger = Mock(Logger) | |
and: 'an instance of fake service' | |
def service = prepareServiceWithLogger(logger) | |
when: | |
service.myBusinessMethod() | |
then: | |
1 * logger.debug("Entering method") // should log once | |
} | |
@Ignore def prepareServiceWithLogger(def logger) { | |
new FakeService() // here we should return instance of modified class | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment