iterm2_tab_formatter 0.7.2 → 0.7.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -39,7 +39,9 @@ class Iterm2TabFormatter
39
39
  pass_ratio = 1 - (1.0 * failure_count / example_count)
40
40
  controller.tab_title = "#{pass_ratio * 100}% passed"
41
41
 
42
- window_title = Iterm2TabFormatter::TextFormatter.window_title(example_count, failure_count, pending_count)
42
+ window_title = Iterm2TabFormatter::TextFormatter.status(failure_count)
43
+ window_title << ' - '
44
+ window_title << Iterm2TabFormatter::TextFormatter.window_title(example_count, failure_count, pending_count)
43
45
  window_title << ' - '
44
46
  window_title << Iterm2TabFormatter::TextFormatter.duration(duration)
45
47
  window_title << ' - Finished at '
@@ -30,6 +30,10 @@ class Iterm2TabFormatter
30
30
 
31
31
  text
32
32
  end
33
+
34
+ def status(failure_count)
35
+ failure_count == 0 ? 'PASS' : 'FAIL'
36
+ end
33
37
  end
34
38
  end
35
39
  end
@@ -5,5 +5,5 @@ rescue LoadError
5
5
  end
6
6
 
7
7
  class Iterm2TabFormatter
8
- VERSION = "0.7.2"
8
+ VERSION = "0.7.3"
9
9
  end
@@ -57,10 +57,11 @@ describe Iterm2TabFormatter do
57
57
 
58
58
  it 'sets the window title through TextFormatter' do
59
59
  Time.should_receive(:now).and_return('time_now')
60
+ Iterm2TabFormatter::TextFormatter.should_receive(:status).with(3).and_return('PASS_OR_FAIL')
60
61
  Iterm2TabFormatter::TextFormatter.should_receive(:duration).with(5).and_return('the_duration')
61
62
  Iterm2TabFormatter::TextFormatter.should_receive(:window_title).with(10, 3, 4).and_return('window_title')
62
63
  Iterm2TabFormatter::TextFormatter.should_receive(:finished_at).with('time_now').and_return('finish_time')
63
- controller.should_receive(:window_title=).with('window_title - the_duration - Finished at finish_time')
64
+ controller.should_receive(:window_title=).with('PASS_OR_FAIL - window_title - the_duration - Finished at finish_time')
64
65
 
65
66
  formatter.dump_summary(5, 10, 3, 4)
66
67
  end
@@ -34,4 +34,14 @@ describe Iterm2TabFormatter::TextFormatter do
34
34
  expect(described_class.duration(65)).to eq('1m5.0s')
35
35
  end
36
36
  end
37
+
38
+ describe '.status' do
39
+ it 'is "PASS" when there are 0 failures' do
40
+ expect(described_class.status(0)).to eq('PASS')
41
+ end
42
+
43
+ it 'is "FAIL" when there are >0 failures' do
44
+ expect(described_class.status(1)).to eq('FAIL')
45
+ end
46
+ end
37
47
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iterm2_tab_formatter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
4
+ version: 0.7.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -84,7 +84,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
84
84
  version: '0'
85
85
  segments:
86
86
  - 0
87
- hash: 1312978249904540659
87
+ hash: -3358931275503651157
88
88
  required_rubygems_version: !ruby/object:Gem::Requirement
89
89
  none: false
90
90
  requirements:
@@ -93,7 +93,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
93
93
  version: '0'
94
94
  segments:
95
95
  - 0
96
- hash: 1312978249904540659
96
+ hash: -3358931275503651157
97
97
  requirements: []
98
98
  rubyforge_project:
99
99
  rubygems_version: 1.8.25