Created
January 16, 2017 22:33
-
-
Save ian-ellis/f1d1e1a93f273e2c682d746220c28f5a to your computer and use it in GitHub Desktop.
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
package com.theiconic.spockexamples.common.domain.usecases | |
import com.theiconic.spockexamples.common.domain.usecases.ValidateEmailUseCase | |
import spock.lang.Specification | |
import spock.lang.Unroll | |
class ValidEmailUseCaseSpec extends Specification { | |
ValidateEmailUseCase useCase; | |
def setup() { | |
useCase = new ValidateEmailUseCase(); | |
} | |
@Unroll | |
def 'execute() - validates email: #email returns #valid'() { | |
when: | |
def result = useCase.execute(email); | |
then: | |
result == valid | |
where: | |
email | valid | |
'[email protected]' | true | |
'1s__%[email protected]' | true | |
'ian.ellis @theiconic.com.au' | false | |
'ian@theiconic' | false | |
'ian.theinonic.com.au' | false | |
'[email protected]' | true | |
'[email protected]%ldka' | false | |
'[email protected]_sldka' | false | |
'[email protected]' | false | |
'[email protected]' | false | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment