minitest-excludes 1.0.2 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/History.txt +6 -0
- data/Rakefile +2 -0
- data/lib/minitest/excludes.rb +6 -6
- data/test/metametameta.rb +62 -20
- data/test/test_minitest_excludes.rb +12 -17
- metadata +73 -92
- metadata.gz.sig +0 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: fbc9d76be558452342382d8f5168cad3155c1f03
|
4
|
+
data.tar.gz: 23c74a800e7abe8cd532375e54533c62fd379fa6
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 1c7eb8b1ba180eb795898e69a37e0e11119847c2bc15d441151104424621676b5dd4d3bd2d7c41c7d76c36a28d140baedb08da3973ac7df7bafb271846a267fd
|
7
|
+
data.tar.gz: a3d89e7650562220008cce289ceca5c56fa375c6b7608867bccf8412a51ec1f4165cce92d77056819f3dbfc956ea7cadf09fa1a61b23efb37c27a96423dd0c6f
|
checksums.yaml.gz.sig
ADDED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/History.txt
CHANGED
data/Rakefile
CHANGED
data/lib/minitest/excludes.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'minitest/unit'
|
2
2
|
|
3
|
-
module
|
4
|
-
VERSION = "
|
3
|
+
module Minitest::Excludes # :nodoc:
|
4
|
+
VERSION = "2.0.0" # :nodoc:
|
5
5
|
end
|
6
6
|
|
7
7
|
##
|
@@ -36,7 +36,7 @@ end
|
|
36
36
|
# If you want to change where the exclude files are located, you can
|
37
37
|
# set the EXCLUDE_DIR environment variable.
|
38
38
|
|
39
|
-
class
|
39
|
+
class Minitest::Test
|
40
40
|
EXCLUDE_DIR = ENV['EXCLUDE_DIR'] || "test/excludes"
|
41
41
|
|
42
42
|
##
|
@@ -65,11 +65,11 @@ class MiniTest::Unit::TestCase
|
|
65
65
|
end
|
66
66
|
|
67
67
|
class << self
|
68
|
-
alias :
|
68
|
+
alias :old_runnable_methods :runnable_methods # :nodoc:
|
69
69
|
|
70
|
-
def
|
70
|
+
def runnable_methods # :nodoc:
|
71
71
|
load_excludes
|
72
|
-
|
72
|
+
old_runnable_methods
|
73
73
|
end
|
74
74
|
end
|
75
75
|
end
|
data/test/metametameta.rb
CHANGED
@@ -2,42 +2,84 @@ require 'tempfile'
|
|
2
2
|
require 'stringio'
|
3
3
|
require 'minitest/autorun'
|
4
4
|
|
5
|
-
class
|
6
|
-
def
|
7
|
-
|
8
|
-
|
5
|
+
class Minitest::Test
|
6
|
+
def clean s
|
7
|
+
s.gsub(/^ {6}/, '')
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
class MetaMetaMetaTestCase < Minitest::Test
|
12
|
+
attr_accessor :reporter, :output, :tu
|
13
|
+
|
14
|
+
def run_tu_with_fresh_reporter flags = %w[--seed 42]
|
15
|
+
options = Minitest.process_args flags
|
16
|
+
|
17
|
+
@output = StringIO.new("")
|
18
|
+
|
19
|
+
self.reporter = Minitest::CompositeReporter.new
|
20
|
+
reporter << Minitest::SummaryReporter.new(@output, options)
|
21
|
+
reporter << Minitest::ProgressReporter.new(@output, options)
|
22
|
+
|
23
|
+
reporter.start
|
24
|
+
|
25
|
+
yield(reporter) if block_given?
|
26
|
+
|
27
|
+
@tus ||= [@tu]
|
28
|
+
@tus.each do |tu|
|
29
|
+
Minitest::Runnable.runnables.delete tu
|
30
|
+
|
31
|
+
tu.run reporter, options
|
32
|
+
end
|
9
33
|
|
10
|
-
|
34
|
+
reporter.report
|
35
|
+
end
|
36
|
+
|
37
|
+
def first_reporter
|
38
|
+
reporter.reporters.first
|
39
|
+
end
|
11
40
|
|
12
|
-
|
41
|
+
def assert_report expected, flags = %w[--seed 42], &block
|
42
|
+
header = clean <<-EOM
|
43
|
+
Run options: #{flags.map { |s| s =~ /\|/ ? s.inspect : s }.join " "}
|
13
44
|
|
14
|
-
|
45
|
+
# Running:
|
15
46
|
|
16
|
-
1 tests, 1 assertions, 0 failures, 0 errors, 0 skips
|
17
47
|
EOM
|
18
48
|
|
19
|
-
|
20
|
-
|
49
|
+
run_tu_with_fresh_reporter flags, &block
|
50
|
+
|
51
|
+
output = normalize_output @output.string.dup
|
52
|
+
|
53
|
+
assert_equal header + expected, output
|
54
|
+
end
|
55
|
+
|
56
|
+
def normalize_output output
|
57
|
+
output.sub!(/Finished in .*/, "Finished in 0.00")
|
21
58
|
output.sub!(/Loaded suite .*/, 'Loaded suite blah')
|
22
|
-
|
23
|
-
output.gsub!(/
|
24
|
-
output.gsub!(
|
25
|
-
|
59
|
+
|
60
|
+
output.gsub!(/ = \d+.\d\d s = /, ' = 0.00 s = ')
|
61
|
+
output.gsub!(/0x[A-Fa-f0-9]+/, '0xXXX')
|
62
|
+
|
63
|
+
if windows? then
|
64
|
+
output.gsub!(/\[(?:[A-Za-z]:)?[^\]:]+:\d+\]/, '[FILE:LINE]')
|
65
|
+
output.gsub!(/^(\s+)(?:[A-Za-z]:)?[^:]+:\d+:in/, '\1FILE:LINE:in')
|
66
|
+
else
|
67
|
+
output.gsub!(/\[[^\]:]+:\d+\]/, '[FILE:LINE]')
|
68
|
+
output.gsub!(/^(\s+)[^:]+:\d+:in/, '\1FILE:LINE:in')
|
69
|
+
end
|
70
|
+
|
71
|
+
output
|
26
72
|
end
|
27
73
|
|
28
74
|
def setup
|
29
75
|
super
|
30
76
|
srand 42
|
31
|
-
|
32
|
-
@tu =
|
33
|
-
@output = StringIO.new("")
|
34
|
-
MiniTest::Unit.runner = nil # protect the outer runner from the inner tests
|
35
|
-
MiniTest::Unit.output = @output
|
77
|
+
Minitest::Test.reset
|
78
|
+
@tu = nil
|
36
79
|
end
|
37
80
|
|
38
81
|
def teardown
|
39
82
|
super
|
40
|
-
MiniTest::Unit.output = $stdout
|
41
83
|
Object.send :remove_const, :ATestCase if defined? ATestCase
|
42
84
|
end
|
43
85
|
end
|
@@ -1,15 +1,15 @@
|
|
1
1
|
require 'test/metametameta'
|
2
2
|
require 'minitest/excludes'
|
3
3
|
|
4
|
-
class
|
4
|
+
class TestMinitestExcludes < MetaMetaMetaTestCase
|
5
5
|
def test_cls_excludes
|
6
6
|
srand 42
|
7
|
-
old_exclude_base =
|
7
|
+
old_exclude_base = Minitest::Test::EXCLUDE_DIR
|
8
8
|
|
9
9
|
@assertion_count = 0
|
10
10
|
|
11
11
|
Dir.mktmpdir do |path|
|
12
|
-
|
12
|
+
Minitest::Test::EXCLUDE_DIR.replace(path)
|
13
13
|
Dir.mkdir File.join path, "ATestCase"
|
14
14
|
|
15
15
|
s = 'exclude :test_test2, "because it is borked"'
|
@@ -24,12 +24,12 @@ class TestMiniTestExcludes < MetaMetaMetaTestCase
|
|
24
24
|
|
25
25
|
tc1 = tc2 = nil
|
26
26
|
|
27
|
-
tc1 = Class.new(
|
27
|
+
tc1 = Class.new(Minitest::Test) do
|
28
28
|
def test_test1; assert true end
|
29
29
|
def test_test2; assert false end # oh noes!
|
30
30
|
def test_test3; assert true end
|
31
31
|
|
32
|
-
tc2 = Class.new(
|
32
|
+
tc2 = Class.new(Minitest::Test) do
|
33
33
|
def test_test1; assert true end
|
34
34
|
def test_test2; assert false end # oh noes!
|
35
35
|
def test_test3; assert true end
|
@@ -39,29 +39,24 @@ class TestMiniTestExcludes < MetaMetaMetaTestCase
|
|
39
39
|
Object.const_set(:ATestCase, tc1)
|
40
40
|
ATestCase.const_set(:Nested, tc2)
|
41
41
|
|
42
|
-
|
43
|
-
assert_equal %w(test_test1 test_test3), ATestCase::Nested.test_methods
|
42
|
+
@tus = [tc1, tc2]
|
44
43
|
|
45
|
-
|
44
|
+
assert_equal %w(test_test3 test_test1), ATestCase.runnable_methods
|
45
|
+
assert_equal %w(test_test1 test_test3), ATestCase::Nested.runnable_methods
|
46
46
|
|
47
47
|
expected = <<-EOM.gsub(/^ {8}/, '')
|
48
|
-
Run options: --seed 42 --verbose
|
49
|
-
|
50
|
-
# Running tests:
|
51
|
-
|
52
48
|
ATestCase#test_test1 = 0.00 s = .
|
53
49
|
ATestCase#test_test3 = 0.00 s = .
|
54
50
|
ATestCase::Nested#test_test1 = 0.00 s = .
|
55
51
|
ATestCase::Nested#test_test3 = 0.00 s = .
|
56
52
|
|
53
|
+
Finished in 0.00
|
57
54
|
|
58
|
-
|
59
|
-
|
60
|
-
4 tests, 4 assertions, 0 failures, 0 errors, 0 skips
|
55
|
+
4 runs, 4 assertions, 0 failures, 0 errors, 0 skips
|
61
56
|
EOM
|
62
|
-
assert_report expected
|
57
|
+
assert_report expected, %w[--seed 42 --verbose]
|
63
58
|
end
|
64
59
|
ensure
|
65
|
-
|
60
|
+
Minitest::Test::EXCLUDE_DIR.replace(old_exclude_base)
|
66
61
|
end
|
67
62
|
end
|
metadata
CHANGED
@@ -1,24 +1,18 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: minitest-excludes
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 1
|
8
|
-
- 0
|
9
|
-
- 2
|
10
|
-
version: 1.0.2
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 2.0.0
|
11
5
|
platform: ruby
|
12
|
-
authors:
|
6
|
+
authors:
|
13
7
|
- Ryan Davis
|
14
8
|
autorequire:
|
15
9
|
bindir: bin
|
16
|
-
cert_chain:
|
10
|
+
cert_chain:
|
17
11
|
- |
|
18
12
|
-----BEGIN CERTIFICATE-----
|
19
|
-
|
13
|
+
MIIDPjCCAiagAwIBAgIBAjANBgkqhkiG9w0BAQUFADBFMRMwEQYDVQQDDApyeWFu
|
20
14
|
ZC1ydWJ5MRkwFwYKCZImiZPyLGQBGRYJemVuc3BpZGVyMRMwEQYKCZImiZPyLGQB
|
21
|
-
|
15
|
+
GRYDY29tMB4XDTE0MDkxNzIzMDcwN1oXDTE1MDkxNzIzMDcwN1owRTETMBEGA1UE
|
22
16
|
AwwKcnlhbmQtcnVieTEZMBcGCgmSJomT8ixkARkWCXplbnNwaWRlcjETMBEGCgmS
|
23
17
|
JomT8ixkARkWA2NvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALda
|
24
18
|
b9DCgK+627gPJkB6XfjZ1itoOQvpqH1EXScSaba9/S2VF22VYQbXU1xQXL/WzCkx
|
@@ -28,77 +22,72 @@ cert_chain:
|
|
28
22
|
qhtV7HJxNKuPj/JFH0D2cswvzznE/a5FOYO68g+YCuFi5L8wZuuM8zzdwjrWHqSV
|
29
23
|
gBEfoTEGr7Zii72cx+sCAwEAAaM5MDcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAw
|
30
24
|
HQYDVR0OBBYEFEfFe9md/r/tj/Wmwpy+MI8d9k/hMA0GCSqGSIb3DQEBBQUAA4IB
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
25
|
+
AQAFoDJRokCQdxFfOrmsKX41KOFlU/zjrbDVM9hgB/Ur999M6OXGSi8FitXNtMwY
|
26
|
+
FVjsiAPeU7HaWVVcZkj6IhINelTkXsxgGz/qCzjHy3iUMuZWw36cS0fiWJ5rvH+e
|
27
|
+
hD7uXxJSFuyf1riDGI1aeWbQ74WMwvNstOxLUMiV5a1fzBhlxPqb537ubDjq/M/h
|
28
|
+
zPUFPVYeL5KjDHLCqI2FwIk2sEMOQgjpXHzl+3NlD2LUgUhHDMevmgVua0e2GT1B
|
29
|
+
xJcC6UN6NHMOVMyAXsr2HR0gRRx4ofN1LoP2KhXzSr8UMvQYlwPmE0N5GQv1b5AO
|
30
|
+
VpzF30vNaJK6ZT7xlIsIlwmH
|
37
31
|
-----END CERTIFICATE-----
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
- !ruby/object:Gem::Dependency
|
32
|
+
date: 2015-02-02 00:00:00.000000000 Z
|
33
|
+
dependencies:
|
34
|
+
- !ruby/object:Gem::Dependency
|
42
35
|
name: minitest
|
43
|
-
|
44
|
-
|
45
|
-
none: false
|
46
|
-
requirements:
|
36
|
+
requirement: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
47
38
|
- - ~>
|
48
|
-
- !ruby/object:Gem::Version
|
49
|
-
|
50
|
-
segments:
|
51
|
-
- 4
|
52
|
-
- 0
|
53
|
-
version: "4.0"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '4.0'
|
54
41
|
type: :runtime
|
55
|
-
version_requirements: *id001
|
56
|
-
- !ruby/object:Gem::Dependency
|
57
|
-
name: rdoc
|
58
42
|
prerelease: false
|
59
|
-
|
60
|
-
|
61
|
-
|
43
|
+
version_requirements: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ~>
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '4.0'
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: rdoc
|
50
|
+
requirement: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
62
52
|
- - ~>
|
63
|
-
- !ruby/object:Gem::Version
|
64
|
-
|
65
|
-
segments:
|
66
|
-
- 4
|
67
|
-
- 0
|
68
|
-
version: "4.0"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '4.0'
|
69
55
|
type: :development
|
70
|
-
version_requirements: *id002
|
71
|
-
- !ruby/object:Gem::Dependency
|
72
|
-
name: hoe
|
73
56
|
prerelease: false
|
74
|
-
|
75
|
-
|
76
|
-
requirements:
|
57
|
+
version_requirements: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
77
59
|
- - ~>
|
78
|
-
- !ruby/object:Gem::Version
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '4.0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: hoe
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ~>
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '3.13'
|
84
69
|
type: :development
|
85
|
-
|
70
|
+
prerelease: false
|
71
|
+
version_requirements: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ~>
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '3.13'
|
86
76
|
description: |-
|
87
77
|
minitest/excludes.rb extends MiniTest::Unit::TestCase to provide a
|
88
78
|
clean API for excluding certain tests you don't want to run under
|
89
79
|
certain conditions.
|
90
|
-
email:
|
80
|
+
email:
|
91
81
|
- ryand-ruby@zenspider.com
|
92
82
|
executables: []
|
93
|
-
|
94
83
|
extensions: []
|
95
|
-
|
96
|
-
extra_rdoc_files:
|
84
|
+
extra_rdoc_files:
|
97
85
|
- History.txt
|
98
86
|
- Manifest.txt
|
99
87
|
- README.txt
|
100
|
-
files:
|
88
|
+
files:
|
101
89
|
- .autotest
|
90
|
+
- .gemtest
|
102
91
|
- History.txt
|
103
92
|
- Manifest.txt
|
104
93
|
- README.txt
|
@@ -106,40 +95,32 @@ files:
|
|
106
95
|
- lib/minitest/excludes.rb
|
107
96
|
- test/metametameta.rb
|
108
97
|
- test/test_minitest_excludes.rb
|
109
|
-
- .gemtest
|
110
98
|
homepage: https://github.com/seattlerb/minitest-excludes
|
111
|
-
licenses:
|
112
|
-
|
99
|
+
licenses:
|
100
|
+
- MIT
|
101
|
+
metadata: {}
|
113
102
|
post_install_message:
|
114
|
-
rdoc_options:
|
103
|
+
rdoc_options:
|
115
104
|
- --main
|
116
105
|
- README.txt
|
117
|
-
require_paths:
|
106
|
+
require_paths:
|
118
107
|
- lib
|
119
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
none: false
|
130
|
-
requirements:
|
131
|
-
- - ">="
|
132
|
-
- !ruby/object:Gem::Version
|
133
|
-
hash: 3
|
134
|
-
segments:
|
135
|
-
- 0
|
136
|
-
version: "0"
|
108
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
109
|
+
requirements:
|
110
|
+
- - '>='
|
111
|
+
- !ruby/object:Gem::Version
|
112
|
+
version: '0'
|
113
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - '>='
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
137
118
|
requirements: []
|
138
|
-
|
139
|
-
|
140
|
-
rubygems_version: 1.8.25
|
119
|
+
rubyforge_project:
|
120
|
+
rubygems_version: 2.4.5
|
141
121
|
signing_key:
|
142
|
-
specification_version:
|
143
|
-
summary: minitest/excludes.rb extends MiniTest::Unit::TestCase to provide a clean
|
144
|
-
|
122
|
+
specification_version: 4
|
123
|
+
summary: minitest/excludes.rb extends MiniTest::Unit::TestCase to provide a clean
|
124
|
+
API for excluding certain tests you don't want to run under certain conditions.
|
125
|
+
test_files:
|
145
126
|
- test/test_minitest_excludes.rb
|
metadata.gz.sig
CHANGED
Binary file
|