Last active
October 22, 2024 10:15
-
-
Save attacco/52d9e18b8ce845917c073b635d234342 to your computer and use it in GitHub Desktop.
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 Example extends Specification { | |
| def "test"() { | |
| given: | |
| Cls cls = Spy(new Cls()) | |
| when: | |
| cls.m() | |
| then: | |
| 1 * cls.onChanges({ List<String> lst -> | |
| check(lst) | |
| }) | |
| } | |
| def check(List<String> lst) { | |
| assert lst.size() == 4 | |
| assert lst.every { it instanceof String } // не работает | |
| } | |
| class Cls { | |
| def m() { | |
| onChanges(List.of("a", "a", "a", "b")) | |
| } | |
| def onChanges(List<String> list) { | |
| list.forEach { println it } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment