-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Going on a mad refactoring tangent, adding a coverage-of feature to r…
…eport the coverage of a specific source file
- Loading branch information
Showing
12 changed files
with
472 additions
and
337 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#!/usr/bin/env ruby | ||
require File.expand_path(File.dirname(__FILE__) + '../../lib/cucover') | ||
load Cucumber::BINARY | ||
Cucover::Cli.new(ARGV).start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,8 @@ class Foo | |
def execute | ||
true | ||
end | ||
|
||
def sloppy_method | ||
1/0 | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Feature: Coverage Of | ||
In order to find out how well tested a source file that I'm working on is | ||
As a developer | ||
I want to be able to ask Cucover which features cover which lines of a given source file | ||
|
||
Background: | ||
Given the cache is clear | ||
And I am using the simple example app | ||
And I have run cucover -- features/call_foo.feature | ||
|
||
Scenario: Run a feature that covers only some of the source code in a file | ||
When I run cucover --coverage-of lib/foo.rb | ||
Then it should pass with: | ||
""" | ||
1 features/call_foo.feature class Foo | ||
2 features/call_foo.feature def execute | ||
3 features/call_foo.feature true | ||
4 features/call_foo.feature end | ||
5 | ||
6 def sloppy_method | ||
7 1/0 | ||
8 end | ||
9 features/call_foo.feature end | ||
""" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.