Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stubbing a property getter only works with "it." #1040

Open
Vampire opened this issue Oct 10, 2019 · 1 comment
Open

Stubbing a property getter only works with "it." #1040

Vampire opened this issue Oct 10, 2019 · 1 comment

Comments

@Vampire
Copy link
Member

@Vampire Vampire commented Oct 10, 2019

Having this:

Guild server = Stub {
    it.roles >> [higherRole, lowerRole]
    getRoleById(higherRoleId) >> higherRole
}

works properly.
But removing the it. complains that the test class has no roles property.
So currently it works without qualifier for explicit methods, but not for property getters in property syntax.

@leonard84

This comment has been minimized.

Copy link
Member

@leonard84 leonard84 commented Jan 9, 2020

Yes it is a current not so well documented limitation, either you have to use it.prop or just getProp(). I thought it was documented, but I couldn't find it in the user quide.

If you are up to it, you can look into enhancing the AST rewriter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.