modify reporter for use with guard

This commit is contained in:
John Bintz 2011-09-03 07:54:52 -04:00
parent cae6f16623
commit 7f197c3719
4 changed files with 10 additions and 9 deletions

View File

@ -5,6 +5,7 @@ module Jasmine::Headless
extend Forwardable
def_delegators :report, :length, :[]
def_delegators :last_total, :total, :failed, :time
class << self
def load(file)
@ -29,14 +30,6 @@ module Jasmine::Headless
self
end
def total
last_total.total
end
def failed
last_total.failed
end
def has_used_console?
@report.any? { |entry| entry.class == Jasmine::Headless::ReportMessage::Console }
end
@ -49,6 +42,10 @@ module Jasmine::Headless
}
end
def valid?
last_total != nil
end
private
def last_total

View File

@ -20,6 +20,7 @@ module Jasmine::Headless::ReportMessage
end
def ==(other)
other &&
self.total == other.total &&
self.failed == other.failed &&
self.time == other.time &&

View File

@ -1,5 +1,5 @@
module Jasmine
module Headless
VERSION = "0.6.4"
VERSION = "0.7.0"
end
end

View File

@ -37,6 +37,9 @@ REPORT
report.total.should == 1
report.failed.should == 2
report.should have_used_console
report.time.should == 3.0
report.should be_valid
report.should have_failed_on("Statement Two")
end