사용자 도구

사이트 도구


java:spock

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판 양쪽 다음 판
java:spock [2020/08/27 13:32]
kwon37xi [Argument 의 각 줄을 assert 하게 변경되면서 capture 방식도 바뀜]
java:spock [2020/08/27 13:33]
kwon37xi [Argument 의 각 줄을 assert 하게 변경되면서 capture 방식도 바뀜]
줄 128: 줄 128:
   * 1.2 에서는 Argument 의 Closure 블록에서 조건을 체크하려면 전체를 하나의 true/false 를 반환하게 만들어야 했다.   * 1.2 에서는 Argument 의 Closure 블록에서 조건을 체크하려면 전체를 하나의 true/false 를 반환하게 만들어야 했다.
   * 1.3 부터는 각 줄에 대해 ''then'' 처럼 각자 assert 를 수행하기 때문에 그럴 필요가 없어짐.   * 1.3 부터는 각 줄에 대해 ''then'' 처럼 각자 assert 를 수행하기 때문에 그럴 필요가 없어짐.
 +
 +<code groovy>
 +// 1.2 방식
 +1 * mock.foo({ it.size() > 1 &&  it[0].length == 2 })
 +
 +// 1.3 - 한줄 한줄의 boolean 반환 결과를 자동 체크함.
 +1 * mock.foo({ 
 +    it.size() > 1
 +    it[0].length == 2 })
 +</code>
 +
   * 그러나 그로인해서  Argument capture 방식 변경됨. [[https://github.com/spockframework/spock/issues/970|Argument capture and return value in 1.3-RC1 · Issue #970 · spockframework/spock]]   * 그러나 그로인해서  Argument capture 방식 변경됨. [[https://github.com/spockframework/spock/issues/970|Argument capture and return value in 1.3-RC1 · Issue #970 · spockframework/spock]]
   * [[http://spockframework.org/spock/docs/1.3/release_notes.html|Release Notes]]   * [[http://spockframework.org/spock/docs/1.3/release_notes.html|Release Notes]]
  
 <code groovy> <code groovy>
 +// Argument capture
 def extern = null def extern = null
  
java/spock.txt · 마지막으로 수정됨: 2020/08/27 13:35 저자 kwon37xi