modify reporter for use with guard
This commit is contained in:
parent
cae6f16623
commit
7f197c3719
@ -5,6 +5,7 @@ module Jasmine::Headless
|
|||||||
extend Forwardable
|
extend Forwardable
|
||||||
|
|
||||||
def_delegators :report, :length, :[]
|
def_delegators :report, :length, :[]
|
||||||
|
def_delegators :last_total, :total, :failed, :time
|
||||||
|
|
||||||
class << self
|
class << self
|
||||||
def load(file)
|
def load(file)
|
||||||
@ -29,14 +30,6 @@ module Jasmine::Headless
|
|||||||
self
|
self
|
||||||
end
|
end
|
||||||
|
|
||||||
def total
|
|
||||||
last_total.total
|
|
||||||
end
|
|
||||||
|
|
||||||
def failed
|
|
||||||
last_total.failed
|
|
||||||
end
|
|
||||||
|
|
||||||
def has_used_console?
|
def has_used_console?
|
||||||
@report.any? { |entry| entry.class == Jasmine::Headless::ReportMessage::Console }
|
@report.any? { |entry| entry.class == Jasmine::Headless::ReportMessage::Console }
|
||||||
end
|
end
|
||||||
@ -49,6 +42,10 @@ module Jasmine::Headless
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def valid?
|
||||||
|
last_total != nil
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def last_total
|
def last_total
|
||||||
|
@ -20,6 +20,7 @@ module Jasmine::Headless::ReportMessage
|
|||||||
end
|
end
|
||||||
|
|
||||||
def ==(other)
|
def ==(other)
|
||||||
|
other &&
|
||||||
self.total == other.total &&
|
self.total == other.total &&
|
||||||
self.failed == other.failed &&
|
self.failed == other.failed &&
|
||||||
self.time == other.time &&
|
self.time == other.time &&
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
module Jasmine
|
module Jasmine
|
||||||
module Headless
|
module Headless
|
||||||
VERSION = "0.6.4"
|
VERSION = "0.7.0"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -37,6 +37,9 @@ REPORT
|
|||||||
report.total.should == 1
|
report.total.should == 1
|
||||||
report.failed.should == 2
|
report.failed.should == 2
|
||||||
report.should have_used_console
|
report.should have_used_console
|
||||||
|
report.time.should == 3.0
|
||||||
|
|
||||||
|
report.should be_valid
|
||||||
|
|
||||||
report.should have_failed_on("Statement Two")
|
report.should have_failed_on("Statement Two")
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user