Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add missing it to the property name examples for mocking and
  • Loading branch information
kevin0x90 authored and leonard84 committed Dec 31, 2019
1 parent e2ff629 commit 9d56b96
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 35 deletions.
64 changes: 32 additions & 32 deletions spock-core/src/main/java/spock/mock/MockingApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ public <T> T Mock(
* <pre>
* // type is Person.class, name is "person", returns hard-coded value for {@code name}, expects one call to {@code sing()}
* Person person = Mock {
* name << "Fred"
* it.name >> "Fred"
* 1 * sing()
* }
* </pre>
Expand All @@ -264,7 +264,7 @@ public <T> T Mock(Closure interactions) {
* <pre>
* // type is Person.class, name is "myPerson", returns hard-coded value for {@code name}, expects one call to {@code sing()}
* Person person = Mock(name: "myPerson") {
* name << "Fred"
* it.name >> "Fred"
* 1 * sing()
* }
* </pre>
Expand All @@ -290,7 +290,7 @@ public <T> T Mock(Map<String, Object> options, Closure interactions) {
* <pre>
* // name is "person", type is Person.class, returns hard-code value {@code name}, expects one call to {@code sing()}
* def person = Mock(Person) {
* name << "Fred"
* it.name >> "Fred"
* 1 * sing()
* }
* </pre>
Expand Down Expand Up @@ -321,7 +321,7 @@ public <T> T Mock(
* <pre>
* // type is Person.class, name is "myPerson", returns hard-coded value {@code name}, expects one call to {@code sing()}
* def person = Mock(Person, name: "myPerson") {
* name << "Fred"
* it.name >> "Fred"
* 1 * sing()
* }
* </pre>
Expand Down Expand Up @@ -460,8 +460,8 @@ public <T> T Stub(
* <pre>
* // type is Person.class, name is "person", returns hard-coded values for property {@code name} and method {@code sing()}
* Person person = Stub {
* name << "Fred"
* sing() << "Tra-la-la"
* it.name >> "Fred"
* sing() >> "Tra-la-la"
* }
* </pre>
*
Expand All @@ -485,8 +485,8 @@ public <T> T Stub(Closure interactions) {
* <pre>
* // type is Person.class, name is "myPerson", returns hard-coded values for property {@code name} and method {@code sing()}
* Person person = Stub(name: "myPerson") {
* name << "Fred"
* sing() << "Tra-la-la"
* it.name >> "Fred"
* sing() >> "Tra-la-la"
* }
* </pre>
*
Expand Down Expand Up @@ -519,8 +519,8 @@ public <T> T Stub(
* <pre>
* // name is "person", type is Person.class, returns hard-coded values for property {@code name} and method {@code sing()}
* def person = Stub(Person) {
* name << "Fred"
* sing() << "Tra-la-la"
* it.name >> "Fred"
* sing() >> "Tra-la-la"
* }
* </pre>
*
Expand Down Expand Up @@ -550,8 +550,8 @@ public <T> T Stub(
* <pre>
* // type is Person.class, name is "myPerson", returns hard-coded values for property {@code name} and method {@code sing()}
* def person = Stub(Person, name: "myPerson") {
* name << "Fred"
* sing() << "Tra-la-la"
* it.name >> "Fred"
* sing() >> "Tra-la-la"
* }
* </pre>
*
Expand Down Expand Up @@ -715,7 +715,7 @@ public <T> T Spy(
* <pre>
* // type is Person.class, name is "person", returns hard-coded value for {@code name}, calls real method otherwise
* Person person = Spy {
* name << "Fred"
* it.name >> "Fred"
* }
* </pre>
*
Expand All @@ -739,7 +739,7 @@ public <T> T Spy(Closure interactions) {
* <pre>
* // type is Person.class, name is "myPerson", returns hard-coded value for {@code name}, calls real method otherwise
* Person person = Spy(name: "myPerson") {
* name << "Fred"
* it.name >> "Fred"
* }
* </pre>
*
Expand Down Expand Up @@ -772,7 +772,7 @@ public <T> T Spy(
* <pre>
* // name is "person", type is Person.class, returns hard-code value {@code name}, calls real method otherwise
* def person = Spy(Person) {
* name << "Fred"
* it.name >> "Fred"
* 1 * sing()
* }
* </pre>
Expand Down Expand Up @@ -803,7 +803,7 @@ public <T> T Spy(
* <pre>
* // type is Person.class, name is "myPerson", returns hard-coded value {@code name}, calls real method otherwise
* def person = Spy(Person, name: "myPerson") {
* name << "Fred"
* it.name >> "Fred"
* }
* </pre>
*
Expand Down Expand Up @@ -941,7 +941,7 @@ public <T> T GroovyMock(
* <pre>
* // type is Person.class, name is "person", returns hard-coded value for {@code name}, expects one call to {@code sing()}
* Person person = GroovyMock {
* name << "Fred"
* it.name >> "Fred"
* 1 * sing()
* }
* </pre>
Expand All @@ -966,7 +966,7 @@ public <T> T GroovyMock(Closure interactions) {
* <pre>
* // type is Person.class, name is "myPerson", returns hard-coded value for {@code name}, expects one call to {@code sing()}
* Person person = GroovyMock(name: "myPerson") {
* name << "Fred"
* it.name >> "Fred"
* 1 * sing()
* }
* </pre>
Expand Down Expand Up @@ -1001,7 +1001,7 @@ public <T> T GroovyMock(
* <pre>
* // name is "person", type is Person.class, returns hard-code value {@code name}, expects one call to {@code sing()}
* def person = GroovyMock(Person) {
* name << "Fred"
* it.name >> "Fred"
* 1 * sing()
* }
* </pre>
Expand Down Expand Up @@ -1032,7 +1032,7 @@ public <T> T GroovyMock(
* <pre>
* // type is Person.class, name is "myPerson", returns hard-coded value {@code name}, expects one call to {@code sing()}
* def person = GroovyMock(Person, name: "myPerson") {
* name << "Fred"
* it.name >> "Fred"
* 1 * sing()
* }
* </pre>
Expand Down Expand Up @@ -1172,8 +1172,8 @@ public <T> T GroovyStub(
* <pre>
* // type is Person.class, name is "person", returns hard-coded values for property {@code name} and method {@code sing()}
* Person person = GroovyStub {
* name << "Fred"
* sing() << "Tra-la-la"
* it.name >> "Fred"
* sing() >> "Tra-la-la"
* }
* </pre>
*
Expand All @@ -1197,8 +1197,8 @@ public <T> T GroovyStub(Closure interactions) {
* <pre>
* // type is Person.class, name is "myPerson", returns hard-coded values for property {@code name} and method {@code sing()}
* Person person = GroovyStub(name: "myPerson") {
* name << "Fred"
* sing() << "Tra-la-la"
* it.name >> "Fred"
* sing() >> "Tra-la-la"
* }
* </pre>
*
Expand Down Expand Up @@ -1232,8 +1232,8 @@ public <T> T GroovyStub(
* <pre>
* // name is "person", type is Person.class, returns hard-coded values for property {@code name} and method {@code sing()}
* def person = GroovyStub(Person) {
* name << "Fred"
* sing() << "Tra-la-la"
* it.name >> "Fred"
* sing() >> "Tra-la-la"
* }
* </pre>
*
Expand Down Expand Up @@ -1263,8 +1263,8 @@ public <T> T GroovyStub(
* <pre>
* // type is Person.class, name is "myPerson", returns hard-coded values for property {@code name} and method {@code sing()}
* def person = GroovyStub(Person, name: "myPerson") {
* name << "Fred"
* sing() << "Tra-la-la"
* it.name >> "Fred"
* sing() >> "Tra-la-la"
* }
* </pre>
*
Expand Down Expand Up @@ -1403,7 +1403,7 @@ public <T> T GroovySpy(
* <pre>
* // type is Person.class, name is "person", returns hard-coded value for {@code name}, calls real method otherwise
* Person person = GroovySpy {
* name << "Fred"
* it.name >> "Fred"
* }
* </pre>
*
Expand All @@ -1427,7 +1427,7 @@ public <T> T GroovySpy(Closure interactions) {
* <pre>
* // type is Person.class, name is "myPerson", returns hard-coded value for {@code name}, calls real method otherwise
* Person person = GroovySpy(name: "myPerson") {
* name << "Fred"
* it.name >> "Fred"
* }
* </pre>
*
Expand Down Expand Up @@ -1461,7 +1461,7 @@ public <T> T GroovySpy(
* <pre>
* // name is "person", type is Person.class, returns hard-code value {@code name}, calls real method otherwise
* def person = GroovySpy(Person) {
* name << "Fred"
* it.name >> "Fred"
* 1 * sing()
* }
* </pre>
Expand Down Expand Up @@ -1492,7 +1492,7 @@ public <T> T GroovySpy(
* <pre>
* // type is Person.class, name is "myPerson", returns hard-coded value {@code name}, calls real method otherwise
* def person = GroovySpy(Person, name: "myPerson") {
* name << "Fred"
* it.name >> "Fred"
* }
* </pre>
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
* def conds = new AsyncConditions()
*
* // register async callback
* machine.workDone << { result ->
* machine.workDone >> { result ->
* conds.evaluate {
* assert result == WorkResult.OK
* // could add more explicit conditions here
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
* def result = new BlockingVariable&lt;WorkResult&gt;
*
* // register async callback
* machine.workDone << { r ->
* machine.workDone >> { r ->
* result.set(r)
* }
*
Expand Down Expand Up @@ -124,4 +124,4 @@ public void set(T value) {
this.value = value;
valueReady.countDown();
}
}
}

0 comments on commit 9d56b96

Please sign in to comment.