cucumber-formatters 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b4ef04344a0a573b736f9faf27385e499a6acd64
4
- data.tar.gz: 32c0a96f86b38afc6d2badb7c6781f716b07977d
3
+ metadata.gz: ed08aa8fdea015bad571456b7bb8c2f8d1778c09
4
+ data.tar.gz: 15e4df8505a7092056ab266adf461980bd8cb88c
5
5
  SHA512:
6
- metadata.gz: 91f7d7959c9d36b2390587898e2dc78c5497f156bee761ad7e5c43e3bc299b5842027df21888204d0618ce010888233194611bb2da3656342d326f4b5568f8dc
7
- data.tar.gz: 7d51f5e6abd96bc92461070bdbd217861d25a4c452a39476b753a4f1e2d6a60042c9820174327057fb6405bc066361406a717265574db53ca80f519bd1586de6
6
+ metadata.gz: a5b5b10dba0e0a8a0db97a5cb24d92ec0cb8731e23e602a9ab9314ba431150452e69cfa9881553e4526f09ca066f277c9e87616ac8b139a06a783a13679b0fa4
7
+ data.tar.gz: 21b1bf6df6b2871038ed4d1e6d0d13884d5a06a6c1ead8861144e41eb524407e137f82f03e2cd4b07c37cde039f677223255216b15614ffc171acf87d53c1c00
@@ -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)
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
@@ -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
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: 1.1.0
4
+ version: 1.2.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-11-09 00:00:00.000000000 Z
11
+ date: 2016-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: yard
@@ -117,10 +117,12 @@ files:
117
117
  - LICENSE
118
118
  - README.md
119
119
  - lib/cucumber/formatter/failures.rb
120
+ - lib/cucumber/formatter/rerun_dump.rb
120
121
  - lib/cucumber/formatter/simplecsv.rb
121
122
  - lib/cucumber/formatter/simpledoc.rb
122
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
@@ -150,6 +152,7 @@ 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