Skip to content

Commit

Permalink
Fix some of the Test module to output correctly.
Browse files Browse the repository at this point in the history
  • Loading branch information
treed committed Jul 16, 2009
1 parent 71e0e5e commit fe2f4e3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Test.rb
Expand Up @@ -10,6 +10,8 @@ def plan(num)
print '1..',num,"\n"
$started = 1
$testnum = 1
$todo_upto = 0
$failed = 0
$planned = num
end

Expand Down Expand Up @@ -55,22 +57,22 @@ def todo(reason,count=1)
end

def skip(reason='',count=1)
1.upto(count) { proclaim(1,'# SKIP ' + reason) }
1.upto(count) { flunk('# SKIP ' + reason) }
end

def skip_rest(reason='')
skip(reason,$planned - $testnum)
skip(reason,$planned - $testnum + 1)
end

def proclaim(cond,desc)
if cond then
else
print "n"
print "not "
$failed += 1 if $todo_upto < $testnum
end
print 'ok ', $testnum, ' - ', desc
$testnum += 1
if $todo_reason and $todo_upto < $testnum then
if $todo_reason and $todo_upto >= $testnum then
print $todo_reason
end
puts
Expand Down

0 comments on commit fe2f4e3

Please sign in to comment.