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

Post 'if' coverage and ternary operator #326

Closed
arthurkarganyan opened this issue Jul 25, 2014 · 3 comments
Closed

Post 'if' coverage and ternary operator #326

arthurkarganyan opened this issue Jul 25, 2014 · 3 comments

Comments

@arthurkarganyan
Copy link

Hi!

I am worried about missing one line when you use post 'if' condition. E.g. in such way there is one missing line if a = nil.

if a.present?
b = 10
end

But if I write it in this way, there will be no line missing.

b = 10 if a.present?

Also, this will happen when using ternary operator. Is there any way to avoid this issue?

@sferik
Copy link
Collaborator

sferik commented Jul 25, 2014

Nope. Ruby’s standard library provides line-level (a.k.a. c0) code coverage. Unfortunately, we can’t get more granular than that. There’s a three-year-old issue to add c1 code coverage to the Ruby standard library but there hasn’t been any progress on it, as far as I know.

@sferik sferik closed this as completed Jul 25, 2014
@bf4
Copy link
Collaborator

bf4 commented Jul 25, 2014

@sferik I think we need to start a 'standard responses' section like what nokogiri has https://github.com/sparklemotion/nokogiri/blob/master/STANDARD_RESPONSES.md I don't really see a good, visible place in the README for it.

@arthurkarganyan
Copy link
Author

Thank you very much for your answer!

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

3 participants