fix for new JHW where failure details are part of the report

This commit is contained in:
John Bintz 2011-07-14 06:50:47 -04:00
parent 245eeba260
commit 3fb7d8ac24
2 changed files with 11 additions and 1 deletions

View File

@ -17,7 +17,7 @@ module Guard
if (data = File.read(file).strip).empty? if (data = File.read(file).strip).empty?
Notifier.notify('Spec runner interrupted!', :title => 'Jasmine results', :image => :failed) Notifier.notify('Spec runner interrupted!', :title => 'Jasmine results', :image => :failed)
else else
total, fails, any_console, secs = File.read(file).strip.split('/') total, fails, any_console, secs = data.lines.first.strip.split('/')
Notifier.notify(message(total, fails, secs, any_console == "T"), :title => 'Jasmine results', :image => image(any_console == "T", fails)) Notifier.notify(message(total, fails, secs, any_console == "T"), :title => 'Jasmine results', :image => image(any_console == "T", fails))
fails.to_i fails.to_i

View File

@ -22,6 +22,16 @@ describe Guard::JasmineHeadlessWebkitRunner do
end end
end end
context 'with failures' do
let(:data) { "1/0/F/5\nThis||Is||A||Failure\n" }
it 'should notify with the right information' do
Guard::Notifier.expects(:notify).with("1 test, 0 failures, 5 secs.", { :title => 'Jasmine results', :image => :success })
Guard::JasmineHeadlessWebkitRunner.notify(file)
end
end
context 'system run interrupted' do context 'system run interrupted' do
let(:data) { '' } let(:data) { '' }