cucumber-formatters 0.0.1 → 0.0.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9e831537f797f2d214ea20c3d380ee66517f11c8
4
- data.tar.gz: 591e3225f20f93bdd56f8af1d0535546ebdacb2c
3
+ metadata.gz: ccda781c9ad69ad83b2fbfb715ec6a94eda24c48
4
+ data.tar.gz: 57bb066b286748eebcd3e655c59ca15b5842392d
5
5
  SHA512:
6
- metadata.gz: c352704aa82be205a387538221ca5959cc5309f51e657f1755871b505d894a70e29da5dff268ed4106c3714af87c46b14f5f8051600cd75113e0525f39ed303d
7
- data.tar.gz: 9d666a1db8a59611f17bceffda132c1b175b20dcd870bef765e75256fbc85c2185a39c666dda979f1b414d0ccd0fa19222238030952ea23b164f2ffba1de0ec2
6
+ metadata.gz: b3a81391e13cbef1bcfa1da698a76dc052ad16bb4ff19a8bc0dab6f3f392fee444a502af2563f1335445e01f81f201ca7ec2d4ad10b1921083c60a2642df3ea0
7
+ data.tar.gz: d1db8e3d1c6d776823ee2e186948624db82d423f01f38c794409771eb2edccb69e4db9dfb5f2607b5462a95edbaa4bd0028df7716558e9e4b5dc45cbd8d092e6
@@ -29,39 +29,64 @@ module Cucumber
29
29
  @io.flush
30
30
  end
31
31
 
32
+ def after_features(features)
33
+ print_summary(features)
34
+ end
35
+
32
36
  def before_feature(feature)
33
- @feature = "Feature: #{feature.title}"
37
+ @background_failure = false
34
38
  end
35
39
 
36
- def before_feature_element(feature_element)
37
- @exception = false
38
- @scenario = " Scenario: #{feature_element.title}"
40
+ def feature_name(keyword, name)
41
+ @feature = "#{keyword}: #{name}"
39
42
  end
40
43
 
41
- def before_step(step)
42
- @step = " Step: #{step.name}" unless @exception
44
+ def before_background(background)
45
+ @in_background = true
43
46
  end
44
47
 
45
- def exception(exception, status)
46
- @exception = true
47
- print_scenario_summary
48
- print_exception(exception, status, 6)
49
- @io.puts
50
- @io.flush
48
+ def after_background(background)
49
+ @in_background = false
51
50
  end
52
51
 
53
- def after_features(features)
54
- print_summary(features)
52
+ def background_name(keyword, name, file_colon_line, source_indent)
53
+ @background = " #{keyword}: #{name}"
54
+ end
55
+
56
+ def scenario_name(keyword, name, file_colon_line, source_indent)
57
+ @scenario = " #{keyword}: #{name}"
58
+ end
59
+
60
+ def step_name(keyword, step_match, status, source_indent, background, file_colon_line)
61
+ @step = " #{keyword}#{step_match.format_args}"
62
+ end
63
+
64
+ def exception(exception, status, indent = 6)
65
+ unless @background_failure
66
+ print_scenario_summary
67
+ print_exception(exception, status, indent)
68
+ @io.puts
69
+ @io.flush
70
+ end
71
+ @background_failure = @in_background
72
+ end
73
+
74
+ def after_table_row(table_row)
75
+ if table_row.exception
76
+ @step = " Row: #{table_row.name}"
77
+ exception(table_row.exception, table_row.status, 6)
78
+ end
55
79
  end
56
80
 
57
81
  private
58
82
 
59
83
  def print_scenario_summary
60
84
  @io.puts @feature unless @feature.nil?
61
- @io.puts @scenario unless @scenario.nil?
85
+ @io.puts (@scenario ? @scenario : @background)
62
86
  @io.puts @step unless @step.nil?
87
+ @io.puts @table_row unless @table_row.nil?
63
88
 
64
- @feature, @scenario, @step = nil, nil, nil
89
+ @feature, @background, @scenario, @step = nil, nil, nil, nil
65
90
  end
66
91
 
67
92
  def print_summary(features)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cucumber-formatters
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Slaughter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-14 00:00:00.000000000 Z
11
+ date: 2014-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: yard