cucumber-formatters 0.0.4 → 0.0.5

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: 82122616ef83f2e04469c6a37497ecb30026354a
4
- data.tar.gz: e08477b0b0a1e84fe3ba6eb2ade4f16f9a256622
3
+ metadata.gz: 4ac4cf2d3d1a6ada1f9a2d12ed734976ba52269a
4
+ data.tar.gz: b6a65992cdc94ee52030ed558dc7cf5dfc2c1f6c
5
5
  SHA512:
6
- metadata.gz: 9701a1b49ce471456c591ee7e69b92a47f0eecb9b7cbc9fb0f30dcf878e539bd97e952c9734addcafc595810badb1738eaae16d0f0d989fbccb11a41a11cbacf
7
- data.tar.gz: 9ca18c5f9da9f8c9b1980963a2e19b3343ae7c3c5062943f841e2204ff0b8004f19ea2d09203f24de7bc27c4e26896ab14adccd3a87197e286c5caaa01ea12ca
6
+ metadata.gz: 63498ed3ab21353da3aed8212922fcd31e8dc8dad1b1ca807987f1897a942e4ea0ca8564e758f552eb88df6093d9f15cb81f5f6bf4153ad512afd1403a1fc33a
7
+ data.tar.gz: 04ddfde96af73132768420ab1c4013ffd38b8ade2444e534000473302ae0e47b9456b735b1d971af41beb8fbfb23aca06cecad4486226564848ed00bec3e9a73
@@ -1,4 +1,6 @@
1
1
  require 'cucumber/formatter/failures'
2
+ require 'cucumber/formatter/simplecsv'
3
+ require 'cucumber/formatter/simpledoc'
2
4
  require 'cucumber/cli/main'
3
5
 
4
6
  # Extend Cucumber's builtin formats, so that all the
@@ -7,3 +9,13 @@ Cucumber::Cli::Options::BUILTIN_FORMATS['failures'] = [
7
9
  'Cucumber::Formatter::Failures',
8
10
  'Outputs scenario information and stack trace when a test fails'
9
11
  ]
12
+
13
+ Cucumber::Cli::Options::BUILTIN_FORMATS['simpledoc'] = [
14
+ 'Cucumber::Formatter::SimpleDoc',
15
+ 'Outputs feature, scenario and line number'
16
+ ]
17
+
18
+ Cucumber::Cli::Options::BUILTIN_FORMATS['simplecsv'] = [
19
+ 'Cucumber::Formatter::SimpleCSV',
20
+ 'Outputs feature, scenario and line number in csv format'
21
+ ]
@@ -0,0 +1,31 @@
1
+ require 'cucumber/formatter/io'
2
+ require 'cucumber/formatter/console'
3
+
4
+ module Cucumber
5
+ module Formatter
6
+ # Simple CSV formatter
7
+ class SimpleCSV
8
+ include Cucumber::Formatter::Io
9
+ include Cucumber::Formatter::Console
10
+ attr_reader :runtime
11
+
12
+ def initialize(runtime, path_or_io, options)
13
+ @runtime = runtime
14
+ @io = ensure_io(path_or_io, 'simplecsv')
15
+ @options = options
16
+ end
17
+
18
+ def feature_name(keyword, name)
19
+ @feature = "#{keyword}: #{name.split("\n")[0]}"
20
+ @io.puts @feature
21
+ @io.flush
22
+ end
23
+
24
+ def scenario_name(keyword, name, file_colon_line, _source_indent)
25
+ @scenario = "#{keyword}: #{name}"
26
+ @io.puts "#{@scenario},#{file_colon_line}"
27
+ @io.flush
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,96 @@
1
+ require 'term/ansicolor'
2
+
3
+ require 'cucumber/formatter/io'
4
+ require 'cucumber/formatter/console'
5
+
6
+ module Cucumber
7
+ module Formatter
8
+ # Simple documentation formatter
9
+ class SimpleDoc
10
+ include Cucumber::Formatter::Io
11
+ include Cucumber::Formatter::Console
12
+ include Term::ANSIColor
13
+ attr_reader :runtime
14
+
15
+ def initialize(runtime, path_or_io, options)
16
+ @runtime = runtime
17
+ @io = ensure_io(path_or_io, 'simpledoc')
18
+ @options = options
19
+ end
20
+
21
+ def before_features(_features)
22
+ print_profile_information
23
+ @io.puts 'Testing has started...'
24
+ @io.flush
25
+ end
26
+
27
+ def after_features(features)
28
+ print_summary(features)
29
+ end
30
+
31
+ def before_feature(_feature)
32
+ @background_failure = false
33
+ end
34
+
35
+ def feature_name(keyword, name)
36
+ @feature = "#{keyword}: #{name.split("\n")[0]}"
37
+ @io.puts @feature
38
+ @io.flush
39
+ end
40
+
41
+ def before_background(_background)
42
+ @in_background = true
43
+ end
44
+
45
+ def after_background(_background)
46
+ @in_background = false
47
+ end
48
+
49
+ def background_name(keyword, name, *_args)
50
+ @background = " #{keyword}: #{name}"
51
+ @io.puts @background
52
+ @io.flush
53
+ end
54
+
55
+ def scenario_name(keyword, name, file_colon_line, _source_indent)
56
+ @scenario = " #{keyword}: #{name}"
57
+ @io.puts "#{@scenario}".ljust(75) + yellow(" #{file_colon_line}")
58
+ @io.flush
59
+ end
60
+
61
+ def step_name(keyword, step_match, *_args)
62
+ @step = " #{keyword}#{step_match.format_args}"
63
+ end
64
+
65
+ def exception(exception, status, indent = 6)
66
+ unless @background_failure
67
+ print_scenario_summary
68
+ print_exception(exception, status, indent)
69
+ @io.puts
70
+ @io.flush
71
+ end
72
+ @background_failure = @in_background
73
+ end
74
+
75
+ def after_table_row(table_row)
76
+ return unless table_row.exception
77
+ @step = " Row: #{table_row.name}"
78
+ exception(table_row.exception, table_row.status, 6)
79
+ end
80
+
81
+ private
82
+
83
+ def print_scenario_summary
84
+ @io.puts @step unless @step.nil?
85
+ @io.puts @table_row unless @table_row.nil?
86
+ end
87
+
88
+ def print_summary(features)
89
+ @io.puts
90
+ print_stats(features, @options)
91
+ print_snippets(@options)
92
+ print_passing_wip(@options)
93
+ end
94
+ end
95
+ end
96
+ end
@@ -0,0 +1,7 @@
1
+ require 'spec_helper'
2
+
3
+ describe Cucumber::Formatter::SimpleCSV do
4
+ it 'is a class' do
5
+ Cucumber::Formatter::SimpleCSV.is_a? Class
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ require 'spec_helper'
2
+
3
+ describe Cucumber::Formatter::SimpleDoc do
4
+ it 'is a class' do
5
+ Cucumber::Formatter::SimpleDoc.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: 0.0.4
4
+ version: 0.0.5
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-27 00:00:00.000000000 Z
11
+ date: 2015-07-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: yard
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '10.4'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rubocop
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '0.32'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '0.32'
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: cucumber
71
85
  requirement: !ruby/object:Gem::Requirement
@@ -80,6 +94,20 @@ dependencies:
80
94
  - - "~>"
81
95
  - !ruby/object:Gem::Version
82
96
  version: '2.0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: term-ansicolor
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '1.3'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '1.3'
83
111
  description: A collection of cucumber formatters
84
112
  email: b.p.slaughter@gmail.com
85
113
  executables: []
@@ -90,7 +118,11 @@ files:
90
118
  - README.md
91
119
  - lib/cucumber-formatters.rb
92
120
  - lib/cucumber/formatter/failures.rb
121
+ - lib/cucumber/formatter/simplecsv.rb
122
+ - lib/cucumber/formatter/simpledoc.rb
93
123
  - spec/failures_spec.rb
124
+ - spec/simplecsv_spec.rb
125
+ - spec/simpledoc_spec.rb
94
126
  - spec/spec_helper.rb
95
127
  homepage: http://benslaughter.github.io/cucumber-formatters/
96
128
  licenses:
@@ -112,11 +144,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
112
144
  version: '0'
113
145
  requirements: []
114
146
  rubyforge_project:
115
- rubygems_version: 2.2.2
147
+ rubygems_version: 2.4.8
116
148
  signing_key:
117
149
  specification_version: 4
118
150
  summary: A helpful bunch of formatters
119
151
  test_files:
120
152
  - spec/failures_spec.rb
153
+ - spec/simplecsv_spec.rb
154
+ - spec/simpledoc_spec.rb
121
155
  - spec/spec_helper.rb
122
156
  has_rdoc: