cucumber-formatters 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 9e831537f797f2d214ea20c3d380ee66517f11c8
4
+ data.tar.gz: 591e3225f20f93bdd56f8af1d0535546ebdacb2c
5
+ SHA512:
6
+ metadata.gz: c352704aa82be205a387538221ca5959cc5309f51e657f1755871b505d894a70e29da5dff268ed4106c3714af87c46b14f5f8051600cd75113e0525f39ed303d
7
+ data.tar.gz: 9d666a1db8a59611f17bceffda132c1b175b20dcd870bef765e75256fbc85c2185a39c666dda979f1b414d0ccd0fa19222238030952ea23b164f2ffba1de0ec2
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2014 Ben Slaughter
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
data/README.md ADDED
@@ -0,0 +1,10 @@
1
+ cucumber-formatters
2
+ ===================
3
+
4
+ [![Dependency Status](https://gemnasium.com/benSlaughter/cucumber-formatters.svg)](https://gemnasium.com/benSlaughter/cucumber-formatters)
5
+ [![Coverage Status](https://img.shields.io/coveralls/benSlaughter/cucumber-formatters.svg)](https://coveralls.io/r/benSlaughter/cucumber-formatters)
6
+ [![Build Status](https://travis-ci.org/benSlaughter/cucumber-formatters.svg)](https://travis-ci.org/benSlaughter/cucumber-formatters)
7
+ [![Code Climate](https://codeclimate.com/github/benSlaughter/cucumber-formatters/badges/gpa.svg)](https://codeclimate.com/github/benSlaughter/cucumber-formatters)
8
+ [![Test Coverage](https://codeclimate.com/github/benSlaughter/cucumber-formatters/badges/coverage.svg)](https://codeclimate.com/github/benSlaughter/cucumber-formatters)
9
+
10
+ A few helpful cucumber formatters
@@ -0,0 +1,9 @@
1
+ require 'cucumber/formatter/failures'
2
+ require 'cucumber/cli/main'
3
+
4
+ # Extend Cucumber's builtin formats, so that all the
5
+ # formatters can be used with --format
6
+ Cucumber::Cli::Options::BUILTIN_FORMATS['failures'] = [
7
+ 'Cucumber::Formatter::Failures',
8
+ 'Outputs scenario information and stack trace when a test fails'
9
+ ]
@@ -0,0 +1,75 @@
1
+ require 'cucumber/formatter/io'
2
+ require 'cucumber/formatter/console'
3
+
4
+ module Cucumber
5
+ module Formatter
6
+ # Failure formatter
7
+ # Will only output information when a test fails
8
+ # The output structure is:
9
+ #
10
+ # Feature title
11
+ # Scenario title
12
+ # Step text
13
+ # Full stacktrace
14
+ #
15
+ class Failures
16
+ include Cucumber::Formatter::Io
17
+ include Cucumber::Formatter::Console
18
+ attr_reader :runtime
19
+
20
+ def initialize(runtime, path_or_io, options)
21
+ @runtime = runtime
22
+ @io = ensure_io(path_or_io, 'failures')
23
+ @options = options
24
+ end
25
+
26
+ def before_features(_features)
27
+ print_profile_information
28
+ @io.puts 'Testing has started...'
29
+ @io.flush
30
+ end
31
+
32
+ def before_feature(feature)
33
+ @feature = "Feature: #{feature.title}"
34
+ end
35
+
36
+ def before_feature_element(feature_element)
37
+ @exception = false
38
+ @scenario = " Scenario: #{feature_element.title}"
39
+ end
40
+
41
+ def before_step(step)
42
+ @step = " Step: #{step.name}" unless @exception
43
+ end
44
+
45
+ def exception(exception, status)
46
+ @exception = true
47
+ print_scenario_summary
48
+ print_exception(exception, status, 6)
49
+ @io.puts
50
+ @io.flush
51
+ end
52
+
53
+ def after_features(features)
54
+ print_summary(features)
55
+ end
56
+
57
+ private
58
+
59
+ def print_scenario_summary
60
+ @io.puts @feature unless @feature.nil?
61
+ @io.puts @scenario unless @scenario.nil?
62
+ @io.puts @step unless @step.nil?
63
+
64
+ @feature, @scenario, @step = nil, nil, nil
65
+ end
66
+
67
+ def print_summary(features)
68
+ @io.puts
69
+ print_stats(features, @options)
70
+ print_snippets(@options)
71
+ print_passing_wip(@options)
72
+ end
73
+ end
74
+ end
75
+ end
@@ -0,0 +1,7 @@
1
+ require 'spec_helper'
2
+
3
+ describe Cucumber::Formatter::Failures do
4
+ it 'is a class' do
5
+ Cucumber::Formatter::Failures.is_a? Class
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ require 'codeclimate-test-reporter'
2
+ require 'coveralls'
3
+
4
+ Coveralls.wear!
5
+ CodeClimate::TestReporter.start
6
+
7
+ require 'cucumber-formatters'
metadata ADDED
@@ -0,0 +1,122 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cucumber-formatters
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Ben Slaughter
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-10-14 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: yard
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: coveralls
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: cucumber
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ description: A collection of cucumber formatters
84
+ email: b.p.slaughter@gmail.com
85
+ executables: []
86
+ extensions: []
87
+ extra_rdoc_files: []
88
+ files:
89
+ - LICENSE
90
+ - README.md
91
+ - lib/cucumber-formatters.rb
92
+ - lib/cucumber/formatter/failures.rb
93
+ - spec/failures_spec.rb
94
+ - spec/spec_helper.rb
95
+ homepage: http://benslaughter.github.io/cucumber-formatters/
96
+ licenses:
97
+ - MIT
98
+ metadata: {}
99
+ post_install_message:
100
+ rdoc_options: []
101
+ require_paths:
102
+ - lib
103
+ required_ruby_version: !ruby/object:Gem::Requirement
104
+ requirements:
105
+ - - ">="
106
+ - !ruby/object:Gem::Version
107
+ version: '0'
108
+ required_rubygems_version: !ruby/object:Gem::Requirement
109
+ requirements:
110
+ - - ">="
111
+ - !ruby/object:Gem::Version
112
+ version: '0'
113
+ requirements: []
114
+ rubyforge_project:
115
+ rubygems_version: 2.2.2
116
+ signing_key:
117
+ specification_version: 4
118
+ summary: A helpful bunch of formatters
119
+ test_files:
120
+ - spec/failures_spec.rb
121
+ - spec/spec_helper.rb
122
+ has_rdoc: