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

Coverage depends on formatting of hash #50

Open
rachelober opened this issue Mar 17, 2010 · 5 comments
Open

Coverage depends on formatting of hash #50

rachelober opened this issue Mar 17, 2010 · 5 comments

Comments

@rachelober
Copy link

For one of our models we needed an elaborate hash.

Ex:
FLAT_PAGES = {
"page1" => {
:lie => "content"
},
"page2" => {
:lie => "content",
:css => "content"
},
"page3" => {
:lie => "content",
:css => ["content1", "content2"],
"contact-us" => {
:lie => "contact",
:css => "aspen"
},
"trade-program" => {
:lie => "classic_trade_program",
:css => ["aspen", "aspen_wide", "aspen_sponsors"]
}
}
}

Coverage would show incomplete for the hash even though we knew everything in the hash was being used through our tests - except for the first entry in the hash, everything else shows up as red.

We needed to modify the hash like so to make it 100%:

FLAT_PAGES = {
"page1" => {
:lie => "content"},
"page2" => {
:lie => "content",
:css => "content"},
"page3" => {
:lie => "content",
:css => ["content1", "content2"],
"contact-us" => {
:lie => "contact",
:css => "aspen"},
"trade-program" => {
:lie => "classic_trade_program",
:css => ["aspen", "aspen_wide", "aspen_sponsors"]}}}

@DanielHeath
Copy link

This is really annoying me too - we shouldnt have to choose between accurate coverage metrics and clean code.

@dallas
Copy link

dallas commented Nov 29, 2010

Indeed, I also have come across this problem many times and I too agree that we should be able to write code how we see fit and rcov should be able to determine the actual amount of coverage.

@jjnevis
Copy link

jjnevis commented May 19, 2011

Ditto - and thanks for the "fix" this was really bugging me.

@freshtonic
Copy link

I have also just been bitten by this issue.

+1 for DanielHeath's comment about not having to choose between accurate coverage metrics and clean code.

@abedra
Copy link
Contributor

abedra commented Jan 18, 2012

This is an issue with multiline processing. There are about 6 issues here that all stem from the same source. Once those are fixed, all of these issues will be resolved.

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

No branches or pull requests

6 participants