-
Notifications
You must be signed in to change notification settings - Fork 26
Add notes for known limitations #21
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
Conversation
|
|
||
| == Known Limitations | ||
| * Expressions must be put in one line. Expressions with folded long lines produce nothing report, e.g.: | ||
| assert do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A block passed to assert method should contain only one expression, because power_assert just shows first one of expressions.
So it is better to write examples as follows.
assert do
# reported
func(foo: 0123456789, bar: "abcdefg")
end
assert do
# won't be reported
func(foo: 0123456789,
bar: "abcdefg")
end
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I've split them.
README.rdoc
Outdated
| end | ||
| * Returned values from accessor methods, method missing, or "super" produce nothing report, e.g: | ||
| class Foo | ||
| attr_reader :val |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be attr_accessor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, it was just a mistake...
README.rdoc
Outdated
| actual = true | ||
| assert do | ||
| # won't be reported | ||
| if condition then expected == actual else expected != actual end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think most of users use the conditional operator if they want to write a branch in one line.
power_assert can shows the result of condition ? expected == actual : expected != actual, so condition ? expected == actual : expected == actual is better for the example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if condition then expected == actual else expected != actual end is now supported. (See f44e62a)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I've updated the exmaple.
|
Thanks for your PR. |
|
Problems described here are fixed now. Thanks again. |
|
Great! |
This is the initial step to fix #20. Not only the main topic of #20, other known issues told at https://github.com/k-tsj/power_assert/issues/20#issuecomment-323495409 are also there.
第1段階としてREADMEの変更のみのPRとなります。
コメントで教えていただいた他の既知の制限事項についても記載しました。