fuubar-cucumber 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.3
1
+ 0.0.4
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{fuubar-cucumber}
8
- s.version = "0.0.3"
8
+ s.version = "0.0.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Marcin Ciunelis"]
12
- s.date = %q{2010-11-20}
12
+ s.date = %q{2010-11-27}
13
13
  s.description = %q{the instafailing Cucumber progress bar formatter}
14
14
  s.email = %q{marcin.ciunelis@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -4,10 +4,9 @@ module Cucumber
4
4
  module Formatter
5
5
  class Fuubar < Progress
6
6
 
7
- attr_reader :step_count, :finished_count
8
-
9
7
  def initialize(step_mother, path_or_io, options)
10
- @step_count = @finished_count = @step_number = @issues_count = 0
8
+ @step_count = @finished_count = @issues_count = 0
9
+ @in_background = false
11
10
  super
12
11
  end
13
12
 
@@ -16,6 +15,14 @@ module Cucumber
16
15
  @progress_bar = ProgressBar.new(" #{@step_count} steps", @step_count, @io)
17
16
  @progress_bar.bar_mark = '='
18
17
  end
18
+
19
+ def before_background(background)
20
+ @in_background = true
21
+ end
22
+
23
+ def after_background(background)
24
+ @in_background = false
25
+ end
19
26
 
20
27
  def after_features(features)
21
28
  @io.print COLORS[state]
@@ -25,6 +32,7 @@ module Cucumber
25
32
  end
26
33
 
27
34
  def after_step_result(keyword, step_match, multiline_arg, status, exception, source_indent, background)
35
+ return if @in_background
28
36
  @state = :red if status == :failed
29
37
  if [:failed, :undefined].include? status
30
38
  @io.print "\e[K"
@@ -72,20 +80,12 @@ module Cucumber
72
80
  count = 0
73
81
  features = features.instance_variable_get("@features")
74
82
  features.each do |feature|
75
- #get background steps
76
- if feature.instance_variable_get("@background")
77
- background = feature.instance_variable_get("@background")
78
- background.init
79
- background_steps = background.instance_variable_get("@steps").instance_variable_get("@steps")
80
- count += background_steps.size
81
- end
82
83
  #get scenarios
83
84
  feature.instance_variable_get("@feature_elements").each do |scenario|
84
85
  scenario.init
85
86
  #get steps
86
87
  steps = scenario.instance_variable_get("@steps").instance_variable_get("@steps")
87
88
  count += steps.size
88
-
89
89
  #get example table
90
90
  examples = scenario.instance_variable_get("@examples_array")
91
91
  unless examples.nil?
@@ -94,14 +94,6 @@ module Cucumber
94
94
  count += example_matrix.size
95
95
  end
96
96
  end
97
-
98
- #get multiline step tables
99
- steps.each do |step|
100
- multi_arg = step.instance_variable_get("@multiline_arg")
101
- next if multi_arg.nil?
102
- matrix = multi_arg.instance_variable_get("@cell_matrix")
103
- count += matrix.size unless matrix.nil?
104
- end
105
97
  end
106
98
  end
107
99
  return count
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fuubar-cucumber
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 3
10
- version: 0.0.3
9
+ - 4
10
+ version: 0.0.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Marcin Ciunelis
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-11-20 00:00:00 +01:00
18
+ date: 2010-11-27 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency