cucumber-formatters 0.0.5 → 0.1.0

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: 4ac4cf2d3d1a6ada1f9a2d12ed734976ba52269a
4
- data.tar.gz: b6a65992cdc94ee52030ed558dc7cf5dfc2c1f6c
3
+ metadata.gz: dab7e3d60180710452190b1a588de544a9eddfe9
4
+ data.tar.gz: 797b1b00ddb8266f62eba0f568b26848db4ddd87
5
5
  SHA512:
6
- metadata.gz: 63498ed3ab21353da3aed8212922fcd31e8dc8dad1b1ca807987f1897a942e4ea0ca8564e758f552eb88df6093d9f15cb81f5f6bf4153ad512afd1403a1fc33a
7
- data.tar.gz: 04ddfde96af73132768420ab1c4013ffd38b8ade2444e534000473302ae0e47b9456b735b1d971af41beb8fbfb23aca06cecad4486226564848ed00bec3e9a73
6
+ metadata.gz: 47d958adc95426196aeb52af261f8bb8d84eb1737f9133078a715b8cf913bcb38756644bbea18c686ff17f80e1242a7ffaf4f0af2a7abeb7b96e93b218d17dc5
7
+ data.tar.gz: 976456775b581b40533efd35c026906db2fb42c45d3ebc1b9b57be54f3bf388b7697ac23ec668436d531dfbf524a1cd6f22ff6cbc3a16ebf81f8149f038ab1b1
@@ -21,6 +21,13 @@ module Cucumber
21
21
  @runtime = runtime
22
22
  @io = ensure_io(path_or_io, 'failures')
23
23
  @options = options
24
+ @exceptions = []
25
+ @indent = 0
26
+ @prefixes = options[:prefixes] || {}
27
+ @delayed_messages = []
28
+ @previous_step_keyword = nil
29
+ @snippets_input = []
30
+ @output = []
24
31
  end
25
32
 
26
33
  def before_features(_features)
@@ -80,6 +87,10 @@ module Cucumber
80
87
  exception(table_row.exception, table_row.status, 6)
81
88
  end
82
89
 
90
+ def after_test_step(test_step, result)
91
+ collect_snippet_data(test_step, result)
92
+ end
93
+
83
94
  private
84
95
 
85
96
  def print_scenario_summary
@@ -0,0 +1,36 @@
1
+ require 'cucumber/formatter/io'
2
+
3
+ module Cucumber
4
+ module Formatter
5
+ # Works like rerun but just outputs file location and line number
6
+ # Each new test is output to a new line
7
+ class RerunDump
8
+ include Cucumber::Formatter::Io
9
+
10
+ def initialize(_runtime, path_or_io, options)
11
+ @io = ensure_io(path_or_io, 'rundump')
12
+ @results = []
13
+ @options = options
14
+ end
15
+
16
+ def after_test_case(test_case, _result)
17
+ @results << [test_case.location.file, test_case.location.line]
18
+ end
19
+
20
+ def done
21
+ return if @results.empty?
22
+ @io.print file_failures.join("\n")
23
+ end
24
+
25
+ [:before_test_case, :before_test_step, :after_test_step].each do |method|
26
+ define_method(method) { |*| }
27
+ end
28
+
29
+ private
30
+
31
+ def file_failures
32
+ @results.map { |file, lines| [file, lines].join(':') }
33
+ end
34
+ end
35
+ end
36
+ end
@@ -54,7 +54,7 @@ module Cucumber
54
54
 
55
55
  def scenario_name(keyword, name, file_colon_line, _source_indent)
56
56
  @scenario = " #{keyword}: #{name}"
57
- @io.puts "#{@scenario}".ljust(75) + yellow(" #{file_colon_line}")
57
+ @io.puts @scenario.to_s.ljust(75) + yellow(" #{file_colon_line}")
58
58
  @io.flush
59
59
  end
60
60
 
@@ -74,7 +74,8 @@ module Cucumber
74
74
 
75
75
  def after_table_row(table_row)
76
76
  return unless table_row.exception
77
- @step = " Row: #{table_row.name}"
77
+ @table_row = table_row
78
+ @step = " Row: #{table_row.name}"
78
79
  exception(table_row.exception, table_row.status, 6)
79
80
  end
80
81
 
@@ -1,4 +1,5 @@
1
1
  require 'cucumber/formatter/failures'
2
+ require 'cucumber/formatter/rerun_dump'
2
3
  require 'cucumber/formatter/simplecsv'
3
4
  require 'cucumber/formatter/simpledoc'
4
5
  require 'cucumber/cli/main'
@@ -10,6 +11,11 @@ Cucumber::Cli::Options::BUILTIN_FORMATS['failures'] = [
10
11
  'Outputs scenario information and stack trace when a test fails'
11
12
  ]
12
13
 
14
+ Cucumber::Cli::Options::BUILTIN_FORMATS['rerundump'] = [
15
+ 'Cucumber::Formatter::RerunDump',
16
+ 'Outputs scenario file and line number on new lines. For use with --dry-run'
17
+ ]
18
+
13
19
  Cucumber::Cli::Options::BUILTIN_FORMATS['simpledoc'] = [
14
20
  'Cucumber::Formatter::SimpleDoc',
15
21
  'Outputs feature, scenario and line number'
@@ -0,0 +1,7 @@
1
+ require 'spec_helper'
2
+
3
+ describe Cucumber::Formatter::RerunDump do
4
+ it 'is a class' do
5
+ Cucumber::Formatter::RerunDump.is_a? Class
6
+ end
7
+ end
@@ -1,7 +1,5 @@
1
- require 'codeclimate-test-reporter'
2
1
  require 'coveralls'
3
2
 
4
3
  Coveralls.wear!
5
- CodeClimate::TestReporter.start
6
4
 
7
- require 'cucumber-formatters'
5
+ require 'cucumber/formatters'
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.5
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Slaughter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-17 00:00:00.000000000 Z
11
+ date: 2017-02-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: yard
@@ -84,16 +84,16 @@ dependencies:
84
84
  name: cucumber
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - "~>"
87
+ - - '='
88
88
  - !ruby/object:Gem::Version
89
- version: '2.0'
89
+ version: 2.0.0
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - "~>"
94
+ - - '='
95
95
  - !ruby/object:Gem::Version
96
- version: '2.0'
96
+ version: 2.0.0
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: term-ansicolor
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -116,11 +116,13 @@ extra_rdoc_files: []
116
116
  files:
117
117
  - LICENSE
118
118
  - README.md
119
- - lib/cucumber-formatters.rb
120
119
  - lib/cucumber/formatter/failures.rb
120
+ - lib/cucumber/formatter/rerun_dump.rb
121
121
  - lib/cucumber/formatter/simplecsv.rb
122
122
  - lib/cucumber/formatter/simpledoc.rb
123
+ - lib/cucumber/formatters.rb
123
124
  - spec/failures_spec.rb
125
+ - spec/rerun_dump_spec.rb
124
126
  - spec/simplecsv_spec.rb
125
127
  - spec/simpledoc_spec.rb
126
128
  - spec/spec_helper.rb
@@ -144,13 +146,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
144
146
  version: '0'
145
147
  requirements: []
146
148
  rubyforge_project:
147
- rubygems_version: 2.4.8
149
+ rubygems_version: 2.5.1
148
150
  signing_key:
149
151
  specification_version: 4
150
152
  summary: A helpful bunch of formatters
151
153
  test_files:
152
154
  - spec/failures_spec.rb
155
+ - spec/rerun_dump_spec.rb
153
156
  - spec/simplecsv_spec.rb
154
157
  - spec/simpledoc_spec.rb
155
158
  - spec/spec_helper.rb
156
- has_rdoc: