Closed
Description
The JavaDoc show invalid examples and should be reviewed for errors.
For example in MockingApi
the Mock
and Stub
methods use leftshift for defining return values instead of rightshift:
// 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"
}
Also would name >> "Fred"
be valid?
Because I tried to do it like that and got No such property: author for class: net.kautler.command.api.restriction.javacord.BotOwnerJavacordTest
I also tried delegate.name
, in which case I get no error, but the call is not recorded at all.
Same with delegate.getName()
.
(I tried to make CodeNarc happy which checks that you use property syntax if you can and it doesn't recognize that you cannot there which might actually be a bug)
Update: Aah, it.name
works.
Metadata
Metadata
Assignees
Labels
No labels
Activity