minitest-screenshot-reporter 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: e6b0c2ca9d2ede0a204ebec28c4ef15129da10aa
4
+ data.tar.gz: c13b99e3913eeee9f33c6b60398933fbeedf60c4
5
+ SHA512:
6
+ metadata.gz: 2bfe079c84487fac90af67c032aab4460ba741f4ce746e3d40de0a6350f8f2042096281fb62b928f674511a3c7ee66cde57a43b8092519ffd1aca9fe007e8644
7
+ data.tar.gz: 3b30292f751785e7793ced821bda812332c5baf3d4ac7d88e019cef0408286c2ceaca6c590831d6c56be336a299d65be1cce8ccc01f97949c189d81e29b90661
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
@@ -0,0 +1 @@
1
+ 2.3.0
@@ -0,0 +1,6 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.1.5
4
+ - 2.2.3
5
+ - 2.3.0
6
+ before_install: gem install bundler -v 1.11.2
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in minitest-screenshot-reporter.gemspec
4
+ gemspec
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 Igor Jancev
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
13
+ all 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
21
+ THE SOFTWARE.
@@ -0,0 +1,63 @@
1
+ # MinitestScreenshotReporter
2
+
3
+ [![Gem Version](http://img.shields.io/gem/v/minitest-screenshot-reporter.svg)][gem]
4
+ [![Build Status](http://img.shields.io/travis/igorj/minitest-screenshot-reporter.svg)][travis]
5
+ [![Dependency Status](http://img.shields.io/gemnasium/igorj/minitest-screenshot-reporter.svg)][gemnasium]
6
+ [![Code Climate](http://img.shields.io/codeclimate/github/igorj/minitest-screenshot-reporter.svg)][codeclimate]
7
+ [![Coverage Status](http://img.shields.io/coveralls/igorj/minitest-screenshot-reporter.svg)][coveralls]
8
+
9
+ [gem]: https://rubygems.org/gems/minitest-screenshot-reporter
10
+ [travis]: http://travis-ci.org/igorj/minitest-screenshot-reporter
11
+ [gemnasium]: https://gemnasium.com/igorj/minitest-screenshot-reporter
12
+ [codeclimate]: https://codeclimate.com/github/igorj/minitest-screenshot-reporter
13
+ [coveralls]: https://coveralls.io/r/igorj/minitest-screenshot-reporter
14
+
15
+
16
+ Minitest reporter that automatically creates a screenshot on error or failure.
17
+
18
+ ## Installation
19
+
20
+ Add this line to your application's Gemfile:
21
+
22
+ ```ruby
23
+ gem 'minitest-screenshot-reporter'
24
+ ```
25
+
26
+ And then execute:
27
+
28
+ $ bundle
29
+
30
+ Or install it yourself as:
31
+
32
+ $ gem install minitest-screenshot-reporter
33
+
34
+ ## Usage
35
+
36
+ Use as any other minitest reporter with `Minitest::Reporters.use!
37
+
38
+ Example: Add following to your *test_helper.rb*:
39
+
40
+ ```ruby
41
+ require 'minitest/reporters'
42
+ require 'minitest/reporters/screenshot_reporter'
43
+ Minitest::Reporters.use! [Minitest::Reporters::SpecReporter.new,
44
+ Minitest::Reporters::ScreenshotReporter.new]
45
+ ```
46
+
47
+ Run your tests, and if there are errors or failures in your integration tests, check the directory *test/screenshots*.
48
+
49
+ ## Development
50
+
51
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
52
+
53
+ To install this gem onto your local machine, run `bundle exec rake install`.
54
+
55
+ To release a new version, run `bundle exec rake release_patch`, `bundle exec rake release_minor`, oder `bundle exec rake release_major`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to https://rubygems.org.
56
+
57
+ ## Contributing
58
+
59
+ Bug reports and pull requests are welcome on github at https://github.com/igorj/minitest-screenshot-reporter.
60
+
61
+ ## License
62
+
63
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
@@ -0,0 +1,38 @@
1
+ require "bundler/gem_tasks"
2
+ require "rake/testtask"
3
+
4
+ Rake::TestTask.new(:test) do |t|
5
+ t.libs << "test"
6
+ t.libs << "lib"
7
+ t.test_files = FileList['test/**/*_test.rb']
8
+ end
9
+
10
+ task :patch do
11
+ system "gem bump --tag"
12
+ end
13
+
14
+ task :minor do
15
+ system "gem bump --version minor --tag"
16
+ end
17
+
18
+ task :major do
19
+ system "gem bump --version major --tag"
20
+ end
21
+
22
+ task :publish => [:build] do
23
+ $VERBOSE = nil
24
+ load 'minitest-screenshot-reporter/version.rb'
25
+ system "gem push pkg/minitest-screenshot-reporter-#{MinitestScreenshotReporter::VERSION}.gem"
26
+ end
27
+
28
+ desc "Bump patch version, create git tag, build the gem and release to geminabox (default)"
29
+ task :release_patch => [:test, :patch, :publish]
30
+
31
+ desc "Bump minor version, create git tag, build the gem and release to geminabox"
32
+ task :release_minor => [:test, :minor, :publish]
33
+
34
+ desc "Bump major version, create git tag, build the gem and release to geminabox"
35
+ task :release_major => [:test, :major, :publish]
36
+
37
+
38
+ task :default => :test
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "<%= @gem_name %>"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,4 @@
1
+ require 'minitest-screenshot-reporter/version'
2
+
3
+ module MinitestScreenshotReporter
4
+ end
@@ -0,0 +1,3 @@
1
+ module MinitestScreenshotReporter
2
+ VERSION = '0.0.1'
3
+ end
@@ -0,0 +1,23 @@
1
+ require 'capybara/dsl'
2
+
3
+ # Use with capybara integration tests
4
+ #
5
+ class Minitest::Reporters::ScreenshotReporter < Minitest::Reporters::BaseReporter
6
+ include Capybara::DSL
7
+
8
+ @count = 1
9
+
10
+ class << self
11
+ attr_accessor :count
12
+ end
13
+
14
+ def record(test)
15
+ super
16
+ if test.failure
17
+ test_name = "#{test.class.name}-#{test.name}"
18
+ screenshot_name = test.error? ? "ERROR-#{test_name}.png" : "FAILURE-#{test_name}.png"
19
+ save_screenshot File.join('test/screenshots', "#{self.class.count}-#{screenshot_name}")
20
+ self.class.count += 1
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,29 @@
1
+ $LOAD_PATH.unshift File.expand_path('../lib', __FILE__)
2
+ require 'minitest-screenshot-reporter/version'
3
+
4
+ Gem::Specification.new do |spec|
5
+ spec.name = "minitest-screenshot-reporter"
6
+ spec.version = MinitestScreenshotReporter::VERSION
7
+ spec.authors = ["Igor Jancev"]
8
+ spec.email = ["igor@masterybits.com"]
9
+ spec.summary = %q{Minitest reporter that automatically creates a screenshot on error or failure}
10
+ spec.description = %q{Minitest reporter that automatically creates a screenshot on error or failure}
11
+ spec.homepage = "https://github.com/igorj/minitest-screenshot-reporter"
12
+ spec.license = "MIT"
13
+
14
+
15
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^test/}) }
16
+ spec.require_paths = ["lib"]
17
+
18
+ spec.add_development_dependency "bundler", "~> 1.11"
19
+ spec.add_development_dependency "rake", "~> 10.0"
20
+ spec.add_development_dependency "minitest", "~> 5.8"
21
+ spec.add_development_dependency "minitest-reporters", "~> 1.1"
22
+ spec.add_development_dependency "gem-release", "~> 0.7"
23
+ spec.add_development_dependency "geminabox", "~> 0.13"
24
+ spec.add_development_dependency "coveralls"
25
+
26
+ spec.add_dependency "minitest", ">= 5.0"
27
+ spec.add_dependency "minitest-reporters", "~> 1.1"
28
+ spec.add_dependency "capybara", "~> 2.6"
29
+ end
metadata ADDED
@@ -0,0 +1,198 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: minitest-screenshot-reporter
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Igor Jancev
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-04-21 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.11'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.11'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: minitest
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '5.8'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '5.8'
55
+ - !ruby/object:Gem::Dependency
56
+ name: minitest-reporters
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '1.1'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '1.1'
69
+ - !ruby/object:Gem::Dependency
70
+ name: gem-release
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '0.7'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '0.7'
83
+ - !ruby/object:Gem::Dependency
84
+ name: geminabox
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '0.13'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '0.13'
97
+ - !ruby/object:Gem::Dependency
98
+ name: coveralls
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: minitest
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '5.0'
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '5.0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: minitest-reporters
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '1.1'
132
+ type: :runtime
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '1.1'
139
+ - !ruby/object:Gem::Dependency
140
+ name: capybara
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: '2.6'
146
+ type: :runtime
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: '2.6'
153
+ description: Minitest reporter that automatically creates a screenshot on error or
154
+ failure
155
+ email:
156
+ - igor@masterybits.com
157
+ executables: []
158
+ extensions: []
159
+ extra_rdoc_files: []
160
+ files:
161
+ - ".gitignore"
162
+ - ".ruby-version"
163
+ - ".travis.yml"
164
+ - Gemfile
165
+ - LICENCE.txt
166
+ - README.md
167
+ - Rakefile
168
+ - bin/console
169
+ - bin/setup
170
+ - lib/minitest-screenshot-reporter.rb
171
+ - lib/minitest-screenshot-reporter/version.rb
172
+ - lib/minitest/reporters/screenshot_reporter.rb
173
+ - minitest-screenshot-reporter.gemspec
174
+ homepage: https://github.com/igorj/minitest-screenshot-reporter
175
+ licenses:
176
+ - MIT
177
+ metadata: {}
178
+ post_install_message:
179
+ rdoc_options: []
180
+ require_paths:
181
+ - lib
182
+ required_ruby_version: !ruby/object:Gem::Requirement
183
+ requirements:
184
+ - - ">="
185
+ - !ruby/object:Gem::Version
186
+ version: '0'
187
+ required_rubygems_version: !ruby/object:Gem::Requirement
188
+ requirements:
189
+ - - ">="
190
+ - !ruby/object:Gem::Version
191
+ version: '0'
192
+ requirements: []
193
+ rubyforge_project:
194
+ rubygems_version: 2.5.1
195
+ signing_key:
196
+ specification_version: 4
197
+ summary: Minitest reporter that automatically creates a screenshot on error or failure
198
+ test_files: []