Skip to content

Commit

Permalink
Merge pull request #7 from tmornini/master
Browse files Browse the repository at this point in the history
Skips should not be counted as passes
  • Loading branch information
Tom Mornini committed Mar 22, 2012
2 parents 8f4e91c + ebc791b commit 3bc6a52
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/turn/components/case.rb
Expand Up @@ -65,7 +65,7 @@ def fail?


# Did all tests/assertion pass? # Did all tests/assertion pass?
def pass? def pass?
not(fail? or error?) not(fail? or error? or skip?)
end end


def count_tests def count_tests
Expand All @@ -86,6 +86,10 @@ def count_passes
sum = 0; tests.each{ |t| sum += 1 if t.pass? }; sum sum = 0; tests.each{ |t| sum += 1 if t.pass? }; sum
end end


def skip?
count_skips > 0
end

def count_skips def count_skips
# Why not use tests.select(&:skip?).size ? # Why not use tests.select(&:skip?).size ?
sum = 0; tests.each{ |t| sum += 1 if t.skip? }; sum sum = 0; tests.each{ |t| sum += 1 if t.skip? }; sum
Expand Down

0 comments on commit 3bc6a52

Please sign in to comment.