HELP: Simplecov reports ambiguous hit

11 views
Skip to first unread message

Jozsef Kercso

unread,
Feb 9, 2018, 10:33:16 AM2/9/18
to SimpleCov
Hi All,

  I'm new to SimpleCov, so apologise if my question is a trivial one. So: I'm using the "unless" idiom extensively in my Ruby code in the following way

msg << "Author=#{author}" uness author.nil?

If I run SimpleCov on this line, it always reports a "hit", independent from author. I believe this is because the "unless"  is always evaluated. But I want a "hit" only if author is not nil. Could you please help me how to reach this? I know I could split the code in multiple lines to avoid ambiguity, but this is the last thing I want to do. Is there any other solution?

Thanks,
  Jozsef

Tobias Pfeiffer

unread,
Feb 9, 2018, 10:36:24 AM2/9/18
to simp...@googlegroups.com
Hi,

No currently there sadly is no other solution. This is also a limitation of the underlying ruby tooling we use so nothing that we can fix here. 

Branch coverage might help (not sure atm)  but isn't implemented atm. 

--
You received this message because you are subscribed to the Google Groups "SimpleCov" group.
To unsubscribe from this group and stop receiving emails from it, send an email to simplecov+unsubscribe@googlegroups.com.
To post to this group, send email to simp...@googlegroups.com.
Visit this group at https://groups.google.com/group/simplecov.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages