Skip to content

Conversation

@piroor
Copy link
Contributor

@piroor piroor commented Aug 21, 2017

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となります。
コメントで教えていただいた他の既知の制限事項についても記載しました。


== Known Limitations
* Expressions must be put in one line. Expressions with folded long lines produce nothing report, e.g.:
assert do
Copy link
Member

@k-tsj k-tsj Aug 26, 2017

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

Copy link
Contributor Author

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
Copy link
Member

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.

Copy link
Contributor Author

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
Copy link
Member

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.

Copy link
Member

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)

Copy link
Contributor Author

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.

@k-tsj
Copy link
Member

k-tsj commented Aug 26, 2017

Thanks for your PR.
Can you check my comments?

@piroor
Copy link
Contributor Author

piroor commented Aug 28, 2017

Problems described here are fixed now. Thanks again.

@k-tsj k-tsj merged commit de69808 into ruby:master Aug 31, 2017
@k-tsj
Copy link
Member

k-tsj commented Aug 31, 2017

Great!
Thanks a lot.

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

Successfully merging this pull request may close these issues.

Syntax error for a statement with multiple lines

2 participants