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

Skip the :nocov: comments. #551

Merged
merged 1 commit into from
Jan 26, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions features/config_nocov_token.feature
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Feature:
| lib/faked_project/meta_magic.rb | 100.0 % |
| lib/faked_project/nocov.rb | 100.0 % |

And there should be 5 skipped lines in the source files
And there should be 7 skipped lines in the source files

And the report should be based upon:
| Unit Tests |
Expand Down Expand Up @@ -73,7 +73,7 @@ Feature:
| lib/faked_project/meta_magic.rb | 100.0 % |
| lib/faked_project/nocov.rb | 100.0 % |

And there should be 5 skipped lines in the source files
And there should be 7 skipped lines in the source files

And the report should be based upon:
| Unit Tests |
4 changes: 2 additions & 2 deletions features/skipping_code_blocks_manually.feature
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Feature:
| lib/faked_project/meta_magic.rb | 100.0 % |
| lib/faked_project/nocov.rb | 100.0 % |

And there should be 5 skipped lines in the source files
And there should be 7 skipped lines in the source files

And the report should be based upon:
| Unit Tests |
Expand Down Expand Up @@ -64,7 +64,7 @@ Feature:
| lib/faked_project/meta_magic.rb | 100.0 % |
| lib/faked_project/nocov.rb | 100.0 % |

And there should be 5 skipped lines in the source files
And there should be 7 skipped lines in the source files

And the report should be based upon:
| Unit Tests |
1 change: 1 addition & 0 deletions lib/simplecov/source_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ def process_skipped_lines!
lines.each do |line|
if line.src =~ /^([\s]*)#([\s]*)(\:#{SimpleCov.nocov_token}\:)/
skipping = !skipping
line.skipped!
elsif skipping
line.skipped!
end
Expand Down
8 changes: 4 additions & 4 deletions spec/file_list_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@
expect(subject.missed_lines).to eq(3)
end

it "has 19 never lines" do
expect(subject.never_lines).to eq(19)
it "has 17 never lines" do
expect(subject.never_lines).to eq(17)
end

it "has 14 lines of code" do
expect(subject.lines_of_code).to eq(14)
end

it "has 3 skipped lines" do
expect(subject.skipped_lines).to eq(3)
it "has 5 skipped lines" do
expect(subject.skipped_lines).to eq(5)
end

it "has the correct covered percent" do
Expand Down
8 changes: 4 additions & 4 deletions spec/source_file_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@
expect(subject.missed_lines.map(&:line)).to eq([8])
end

it "returns lines number 1, 5, 6, 9, 10, 11, 15, 16 for never_lines" do
expect(subject.never_lines.map(&:line)).to eq([1, 5, 6, 9, 10, 11, 15, 16])
it "returns lines number 1, 5, 6, 9, 10, 16 for never_lines" do
expect(subject.never_lines.map(&:line)).to eq([1, 5, 6, 9, 10, 16])
end

it "returns line numbers 12, 13, 14 for skipped_lines" do
expect(subject.skipped_lines.map(&:line)).to eq([12, 13, 14])
it "returns line numbers 11, 12, 13, 14, 15 for skipped_lines" do
expect(subject.skipped_lines.map(&:line)).to eq([11, 12, 13, 14, 15])
end

it "has 80% covered_percent" do
Expand Down