minitest_autoskip 1.0.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 998ae0d0761eb82dd77ce35df6d64bf81b64013384fe2533fb0e4aa0657e6c34
4
+ data.tar.gz: 0b95d6785f5c8ad3e55e88dd3d9e0f8c9aa48b9f5c498458ef59b2bb6e876c8c
5
+ SHA512:
6
+ metadata.gz: 5af606d51913dbb667007c1c8d4e1d3ee2d55d1d4fb8eb5614fc043ceb6b7a2f53f1489899e72f352fff6b29e2025f4760655b50c671858ae8c2ac6cda61f993
7
+ data.tar.gz: 72bfdd9746f730c83910c4e88105bfb6312d9c198be1ad9f6e5844108b21f82d0f2f7e0c64b284158b6cfabbe0fc85f619d7f74fefba6a6eabe22b75b8cc3944
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+ Gemfile.lock
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in minitest_autoskip.gemspec
4
+ gemspec
data/LICENSE.md ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2019 Nick Barry
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.
data/README.md ADDED
@@ -0,0 +1,35 @@
1
+ # Minitest Autoskip
2
+
3
+ Treat tests without assertions as having been skipped for reporting purposes.
4
+
5
+ ## Installation
6
+
7
+ Add to an application's Gemfile as a dependency:
8
+
9
+ ```ruby
10
+ gem 'minitest_autoskip'
11
+ ```
12
+
13
+ Install:
14
+
15
+ ```
16
+ bundle install
17
+ ```
18
+
19
+ ## Usage
20
+
21
+ Require the library after Minitest is loaded:
22
+
23
+ ```ruby
24
+ require 'minitest_autoskip'
25
+
26
+ test 'autoskip' do
27
+ # this test will be treated as skipped
28
+ end
29
+ ```
30
+
31
+ ## Issues
32
+
33
+ This library overrides the internals of the Minitest library, and may stop working if Minitest is updated. Please report issues on Github.
34
+
35
+ Tested against Minitest `5.11.3`.
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+ task :default => :spec
@@ -0,0 +1,25 @@
1
+ module Minitest
2
+ class StatisticsReporter < Reporter
3
+ def skips
4
+ # attr_accessor override
5
+ results.length - @failures - @errors
6
+ end
7
+ end
8
+
9
+ module Reportable
10
+ def result_code
11
+ # default -> { self.failure and self.failure.result_code or "." }
12
+ (self.failure and self.failure.result_code) or (self.skipped? and 'S') or "."
13
+ end
14
+
15
+ def skipped?
16
+ # default -> { self.failure and Skip === self.failure }
17
+ (self.failure and Skip === self.failure) or (self.assertions.zero? and not self.error?)
18
+ end
19
+
20
+ def passed?
21
+ # default -> { not self.failure }
22
+ (not self.failure) and (not self.skipped?)
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,32 @@
1
+
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "minitest_autoskip"
7
+ spec.version = "1.0.0"
8
+ spec.authors = ["Nick Barry"]
9
+ spec.email = ["itsnickbarry@protonmail.ch"]
10
+
11
+ spec.summary = "Treat tests without assertions as having been skipped."
12
+ spec.description = "Minitest override which treats tests without assertions as having been skipped for reporting purposes."
13
+ spec.homepage = "https://github.com/itsnickbarry/minitest_autoskip"
14
+ spec.license = "MIT"
15
+
16
+ if spec.respond_to?(:metadata)
17
+ spec.metadata["homepage_uri"] = spec.homepage
18
+ spec.metadata["source_code_uri"] = spec.homepage
19
+ end
20
+
21
+ # Specify which files should be added to the gem when it is released.
22
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
23
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
24
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
25
+ end
26
+ spec.require_paths = ["lib"]
27
+
28
+ spec.add_development_dependency "bundler", "~> 2.0"
29
+ spec.add_development_dependency "rake", "~> 10.0"
30
+
31
+ spec.add_dependency "minitest", ">= 5.0"
32
+ end
metadata ADDED
@@ -0,0 +1,95 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: minitest_autoskip
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Nick Barry
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2019-04-12 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: '2.0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '2.0'
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.0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '5.0'
55
+ description: Minitest override which treats tests without assertions as having been
56
+ skipped for reporting purposes.
57
+ email:
58
+ - itsnickbarry@protonmail.ch
59
+ executables: []
60
+ extensions: []
61
+ extra_rdoc_files: []
62
+ files:
63
+ - ".gitignore"
64
+ - Gemfile
65
+ - LICENSE.md
66
+ - README.md
67
+ - Rakefile
68
+ - lib/minitest_autoskip.rb
69
+ - minitest_autoskip.gemspec
70
+ homepage: https://github.com/itsnickbarry/minitest_autoskip
71
+ licenses:
72
+ - MIT
73
+ metadata:
74
+ homepage_uri: https://github.com/itsnickbarry/minitest_autoskip
75
+ source_code_uri: https://github.com/itsnickbarry/minitest_autoskip
76
+ post_install_message:
77
+ rdoc_options: []
78
+ require_paths:
79
+ - lib
80
+ required_ruby_version: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ version: '0'
85
+ required_rubygems_version: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ requirements: []
91
+ rubygems_version: 3.0.1
92
+ signing_key:
93
+ specification_version: 4
94
+ summary: Treat tests without assertions as having been skipped.
95
+ test_files: []