fuubar-cucumber 0.0.17 → 0.0.18

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,12 @@
1
+ ## 0.0.18 (August 22, 2012) ##
2
+
3
+ ### bug fix
4
+ * Update ruby-progressbar to 1.0.0 (fixes ruby-progress bar bugs) (by [@nashby](https://github.com/nashby))
5
+ * Don't duplicate final progress bar output (7a2aeea) (by [@nashby](https://github.com/nashby))
6
+
7
+ ### enhancements
8
+ * Add ability to disable color with cucumber's `--color` option. #22 (by [@hron](https://github.com/hron))
9
+
1
10
  ## 0.0.17 (July 31, 2012) ##
2
11
 
3
12
  ### bug fix
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "fuubar-cucumber"
3
- s.version = '0.0.17'
3
+ s.version = '0.0.18'
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.authors = ["Marcin Ciunelis", "Vasiliy Ermolovich"]
6
6
  s.email = ["marcin.ciunelis@gmail.com", "younash@gmail.com"]
@@ -15,5 +15,5 @@ Gem::Specification.new do |s|
15
15
  s.require_paths = ["lib"]
16
16
 
17
17
  s.add_dependency 'cucumber', ["~> 1.2.0"]
18
- s.add_dependency 'ruby-progressbar', ["~> 0.11"]
18
+ s.add_dependency 'ruby-progressbar', ["~> 1.0.0"]
19
19
  end
@@ -1,6 +1,7 @@
1
1
  require 'cucumber/formatter/console'
2
+ require 'cucumber/formatter/ansicolor'
2
3
  require 'cucumber/formatter/io'
3
- require 'progressbar'
4
+ require 'ruby-progressbar'
4
5
 
5
6
  module Cucumber
6
7
  module Formatter
@@ -12,14 +13,11 @@ module Cucumber
12
13
 
13
14
  def initialize(step_mother, path_or_io, options)
14
15
  @step_mother, @io, @options = step_mother, ensure_io(path_or_io, "fuubar"), options
15
- @step_count = @finished_count = @issues_count = 0
16
+ @step_count = @issues_count = 0
16
17
  end
17
18
 
18
19
  def after_features(features)
19
20
  @state = :red if step_mother.scenarios(:failed).any?
20
- @io.print COLORS[state]
21
- @progress_bar.finish
22
- @io.print "\e[0m"
23
21
  @io.puts
24
22
  @io.puts
25
23
  print_summary(features)
@@ -27,8 +25,7 @@ module Cucumber
27
25
 
28
26
  def before_features(features)
29
27
  @step_count = get_step_count(features)
30
- @progress_bar = ProgressBar.new(" #{@step_count} steps", @step_count, @io)
31
- @progress_bar.bar_mark = '='
28
+ @progress_bar = ProgressBar.create(:format => ' %c/%C |%w>%i| %e ', :total => @step_count, :output => @io)
32
29
  end
33
30
 
34
31
  def before_background(background)
@@ -43,7 +40,7 @@ module Cucumber
43
40
  return if @in_background || status == :skipped
44
41
  @state = :red if status == :failed
45
42
  if exception and [:failed, :undefined].include? status
46
- @io.print "\e[K"
43
+ @io.print "\e[K" if colors_enabled?
47
44
  @issues_count += 1
48
45
  @io.puts
49
46
  @io.puts "#{@issues_count})"
@@ -88,11 +85,9 @@ module Cucumber
88
85
  COLORS = { :green => "\e[32m", :yellow => "\e[33m", :red => "\e[31m" }
89
86
 
90
87
  def progress(status = 'passed', count = 1)
91
- @io.print COLORS[state]
92
- @finished_count += count
93
- @progress_bar.inc(count)
94
- @progress_bar.instance_variable_set("@title", " #{@finished_count}/#{@step_count}")
95
- @io.print "\e[0m"
88
+ with_colors(COLORS[state]) do
89
+ @progress_bar.progress += count
90
+ end
96
91
  end
97
92
 
98
93
  def get_step_count(features)
@@ -125,6 +120,16 @@ module Cucumber
125
120
  end
126
121
  return count
127
122
  end
123
+
124
+ def with_colors(color, &block)
125
+ @io.print color if colors_enabled?
126
+ yield
127
+ @io.print "\e[0m" if colors_enabled?
128
+ end
129
+
130
+ def colors_enabled?
131
+ Cucumber::Term::ANSIColor.coloring?
132
+ end
128
133
  end
129
134
  end
130
135
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fuubar-cucumber
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.17
4
+ version: 0.0.18
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,11 +10,11 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-07-31 00:00:00.000000000 Z
13
+ date: 2012-08-22 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: cucumber
17
- requirement: &10581380 !ruby/object:Gem::Requirement
17
+ requirement: &22546800 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ~>
@@ -22,18 +22,18 @@ dependencies:
22
22
  version: 1.2.0
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *10581380
25
+ version_requirements: *22546800
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: ruby-progressbar
28
- requirement: &10580420 !ruby/object:Gem::Requirement
28
+ requirement: &22545900 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ~>
32
32
  - !ruby/object:Gem::Version
33
- version: '0.11'
33
+ version: 1.0.0
34
34
  type: :runtime
35
35
  prerelease: false
36
- version_requirements: *10580420
36
+ version_requirements: *22545900
37
37
  description: the instafailing Cucumber progress bar formatter
38
38
  email:
39
39
  - marcin.ciunelis@gmail.com
@@ -68,7 +68,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
68
68
  version: '0'
69
69
  segments:
70
70
  - 0
71
- hash: -125579862188153635
71
+ hash: -3219431044563237244
72
72
  required_rubygems_version: !ruby/object:Gem::Requirement
73
73
  none: false
74
74
  requirements:
@@ -77,7 +77,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
77
77
  version: '0'
78
78
  segments:
79
79
  - 0
80
- hash: -125579862188153635
80
+ hash: -3219431044563237244
81
81
  requirements: []
82
82
  rubyforge_project:
83
83
  rubygems_version: 1.8.10