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

Should lazy Given variables be evaluated before override? #3

Open
cades opened this issue Jun 22, 2016 · 0 comments
Open

Should lazy Given variables be evaluated before override? #3

cades opened this issue Jun 22, 2016 · 0 comments

Comments

@cades
Copy link
Owner

cades commented Jun 22, 2016

Currently, this test will pass:

Given x: -> throw new Error 'oops!'
When -> @x = 'override x'
Then -> "it is ok"

but in rspec-given, this will fail.

Javascript provide Object.defineProperties, which allow developers to define getter and setter separately. As a result, execute setter without executing getter is possible. The question here is: which behavior should it have? Does the semantic is consistent with general evaluation rule?

At this moment, I have no idea about this choice. Have to survey how other projects dealing with this issue.

Any suggestion is welcome!

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

No branches or pull requests

1 participant