minispec-metadata 3.3.1 → 3.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/CHANGELOG.md +9 -0
- data/README.md +0 -2
- data/lib/minispec-metadata/describe.rb +1 -9
- data/lib/minispec-metadata/tags.rb +1 -17
- data/lib/minispec-metadata/version.rb +1 -1
- data/lib/minispec-metadata.rb +0 -3
- data/minispec-metadata.gemspec +2 -2
- data/spec/describe.spec.rb +11 -19
- data/spec/helper.rb +1 -1
- data/spec/tags.spec.rb +86 -90
- metadata +8 -11
- data/.travis.yml +0 -12
- data/lib/backwards.rb +0 -9
- data/lib/minitest/versions.rb +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fcf3ae82eebf144b14585e96d430354d7e824727cb10e02100d1a576558fca70
|
4
|
+
data.tar.gz: 3908d4ead4dee7666ad65249a30d0f6120ee7c5efc08955187bf024c887e004f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 728712fdd55284feb128f7ad277182e78a14b435346737abf39a24e334c89f8d55b5a0503a9413c7e78b8eed471f4368ef10afea054780f601236b913a1fd288
|
7
|
+
data.tar.gz: 74a9176e4c69e7e430eebd94ceb120a57c501c4b379b16e3a5f8a6f95b0120ccc4810125d83237974cbe4b6f9c0a3cf456dfadea7c23a1e1550c2090f1cf761e
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby-
|
1
|
+
ruby-3.1.2
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
## 3.4
|
2
|
+
|
3
|
+
* Removed support for Ruby <2, Minitest <5.
|
4
|
+
* Convert remaining use of MiniTest to Minitest. (@manuelvanrijn)
|
5
|
+
|
6
|
+
## >3.2.1 <3.4
|
7
|
+
|
8
|
+
Lazily (not) documented here.
|
9
|
+
|
1
10
|
## 3.2.1
|
2
11
|
|
3
12
|
* Remove backwards compatibility for `__dir__`. (Thanks @brennovich for noticiing.)
|
data/README.md
CHANGED
@@ -4,15 +4,7 @@ module MinispecMetadata
|
|
4
4
|
def describe(desc, *additional_desc, &block)
|
5
5
|
metadata = MinispecMetadata.extract_metadata additional_desc
|
6
6
|
|
7
|
-
|
8
|
-
# Minitest 4 allows max 1 additional_desc.
|
9
|
-
# So we need to pass up only the number of allowed additional_desc.
|
10
|
-
additional_allowed =
|
11
|
-
if Minitest::Versions::MAJOR <= 4
|
12
|
-
additional_desc.first(1)
|
13
|
-
else
|
14
|
-
additional_desc
|
15
|
-
end
|
7
|
+
additional_allowed = additional_desc
|
16
8
|
|
17
9
|
cls = super(desc, *additional_allowed.compact, &block)
|
18
10
|
cls.extend ClassMethods
|
@@ -10,20 +10,6 @@ module MinispecMetadata
|
|
10
10
|
tags << Tag.new(tag_string)
|
11
11
|
end
|
12
12
|
|
13
|
-
def supports_tags?
|
14
|
-
minitest_version_supports_tags? && ruby_version_supports_tags?
|
15
|
-
end
|
16
|
-
|
17
|
-
# Because of plugin system.
|
18
|
-
def minitest_version_supports_tags?
|
19
|
-
Minitest::Versions::MAJOR >= 5
|
20
|
-
end
|
21
|
-
|
22
|
-
# Because of #prepend.
|
23
|
-
def ruby_version_supports_tags?
|
24
|
-
RUBY_VERSION.to_i >= 2
|
25
|
-
end
|
26
|
-
|
27
13
|
end
|
28
14
|
|
29
15
|
module MinispecMetadata
|
@@ -102,6 +88,4 @@ module MinispecMetadata
|
|
102
88
|
|
103
89
|
end
|
104
90
|
|
105
|
-
|
106
|
-
Minitest::Test.singleton_class.send :prepend, MinispecMetadata::Tags
|
107
|
-
end
|
91
|
+
Minitest::Test.singleton_class.send :prepend, MinispecMetadata::Tags
|
data/lib/minispec-metadata.rb
CHANGED
data/minispec-metadata.gemspec
CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |gem|
|
|
8
8
|
gem.version = MinispecMetadata::VERSION
|
9
9
|
gem.authors = ["Jared Ning"]
|
10
10
|
gem.email = ["jared@redningja.com"]
|
11
|
-
gem.description = %q{
|
12
|
-
gem.summary = %q{Pass metadata to
|
11
|
+
gem.description = %q{Minitest::Spec metadata}
|
12
|
+
gem.summary = %q{Pass metadata to Minitest::Spec descriptions and specs like in RSpec.}
|
13
13
|
gem.homepage = "https://github.com/ordinaryzelig/minispec-metadata"
|
14
14
|
gem.license = 'MIT'
|
15
15
|
|
data/spec/describe.spec.rb
CHANGED
@@ -93,21 +93,17 @@ describe MinispecMetadata::Describe, 'additional description' do
|
|
93
93
|
|
94
94
|
end
|
95
95
|
|
96
|
-
|
97
|
-
|
98
|
-
describe 'stuff', 'more stuff', {even_more: 'stuff'}, :holy_cow_that_is_a_lot_of_stuff, :minitest_5 do
|
99
|
-
|
100
|
-
it 'preserves additional description but still allows any value for metadata', :more? => 'yeah' do
|
101
|
-
self.class.descs.must_equal ['stuff', 'more stuff', {even_more: 'stuff'}, :holy_cow_that_is_a_lot_of_stuff, :minitest_5]
|
102
|
-
metadata.must_equal(
|
103
|
-
'more stuff' => true,
|
104
|
-
:even_more => 'stuff',
|
105
|
-
:holy_cow_that_is_a_lot_of_stuff => true,
|
106
|
-
:more? => 'yeah',
|
107
|
-
:minitest_5 => true,
|
108
|
-
)
|
109
|
-
end
|
96
|
+
describe 'stuff', 'more stuff', {even_more: 'stuff'}, :holy_cow_that_is_a_lot_of_stuff, :minitest_5 do
|
110
97
|
|
98
|
+
it 'preserves additional description but still allows any value for metadata', :more? => 'yeah' do
|
99
|
+
self.class.descs.must_equal ['stuff', 'more stuff', {even_more: 'stuff'}, :holy_cow_that_is_a_lot_of_stuff, :minitest_5]
|
100
|
+
metadata.must_equal(
|
101
|
+
'more stuff' => true,
|
102
|
+
:even_more => 'stuff',
|
103
|
+
:holy_cow_that_is_a_lot_of_stuff => true,
|
104
|
+
:more? => 'yeah',
|
105
|
+
:minitest_5 => true,
|
106
|
+
)
|
111
107
|
end
|
112
108
|
|
113
109
|
end
|
@@ -115,11 +111,7 @@ end
|
|
115
111
|
describe MinispecMetadata::Describe, 'additional description', :respect do
|
116
112
|
|
117
113
|
it 'respects additional description' do
|
118
|
-
|
119
|
-
self.class.name.must_equal 'MinispecMetadata::Describe::additional description'
|
120
|
-
else
|
121
|
-
self.class.name.must_equal 'MinispecMetadata::Describe::additional description::respect'
|
122
|
-
end
|
114
|
+
self.class.name.must_equal 'MinispecMetadata::Describe::additional description::respect'
|
123
115
|
metadata.must_equal(
|
124
116
|
'additional description' => true,
|
125
117
|
:respect => true,
|
data/spec/helper.rb
CHANGED
data/spec/tags.spec.rb
CHANGED
@@ -1,110 +1,106 @@
|
|
1
1
|
require_relative 'helper'
|
2
|
-
#require_relative 'test_tags_verifier' if ENV['TEST_TAGS'] && MinispecMetadata.supports_tags?
|
3
2
|
|
4
|
-
|
3
|
+
module MinispecMetadata
|
4
|
+
describe Tag do
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
tag.key.must_equal 'sure'
|
12
|
-
tag.value?.must_equal false
|
13
|
-
end
|
14
|
-
|
15
|
-
it 'captures metadata key/value' do
|
16
|
-
tag = Tag.new('key:value')
|
17
|
-
tag.key.must_equal 'key'
|
18
|
-
tag.value.must_equal 'value'
|
19
|
-
end
|
6
|
+
it 'captures the metadata key' do
|
7
|
+
tag = Tag.new('~sure')
|
8
|
+
tag.key.must_equal 'sure'
|
9
|
+
tag.value?.must_equal false
|
10
|
+
end
|
20
11
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
12
|
+
it 'captures metadata key/value' do
|
13
|
+
tag = Tag.new('key:value')
|
14
|
+
tag.key.must_equal 'key'
|
15
|
+
tag.value.must_equal 'value'
|
16
|
+
end
|
25
17
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
18
|
+
it 'captures inclusivity' do
|
19
|
+
tag = Tag.new('sure')
|
20
|
+
tag.must_be :inclusive?
|
21
|
+
end
|
30
22
|
|
23
|
+
it 'captures exclusivity' do
|
24
|
+
tag = Tag.new('~sure')
|
25
|
+
tag.must_be :exclusive?
|
31
26
|
end
|
32
27
|
|
33
|
-
|
34
|
-
def self.passing_test(*args)
|
35
|
-
it *args do
|
36
|
-
pass
|
37
|
-
end
|
38
|
-
end
|
28
|
+
end
|
39
29
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
passing_test '6', 'specific' => :value, unmatched: :value
|
46
|
-
passing_test '7', 'specific' => 'value'
|
30
|
+
TAGS_TEST = describe Tags do
|
31
|
+
def self.passing_test(*args)
|
32
|
+
it *args do
|
33
|
+
pass
|
34
|
+
end
|
47
35
|
end
|
48
36
|
|
49
|
-
|
50
|
-
|
37
|
+
passing_test '1', :minitest_5
|
38
|
+
passing_test '2', 'minitest_5', :slow
|
39
|
+
passing_test '3', :minitest_4
|
40
|
+
passing_test '4', :minitest_4, 'slow'
|
41
|
+
passing_test '5', :slow, specific: 'value'
|
42
|
+
passing_test '6', 'specific' => :value, unmatched: :value
|
43
|
+
passing_test '7', 'specific' => 'value'
|
44
|
+
end
|
51
45
|
|
52
|
-
|
53
|
-
|
54
|
-
MinispecMetadata.stub :tags, tags, &block
|
55
|
-
end
|
46
|
+
# Test the #runnable_methods of tags_test above with different sets of Tags.
|
47
|
+
describe '#runnable_methods' do
|
56
48
|
|
57
|
-
|
58
|
-
|
59
|
-
|
49
|
+
def stub_tags(tag_strings, &block)
|
50
|
+
tags = tag_strings.map { |tag_string| Tag.new(tag_string) }
|
51
|
+
MinispecMetadata.stub :tags, tags, &block
|
52
|
+
end
|
60
53
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
54
|
+
def strip_prefix(name)
|
55
|
+
name.sub /^test_\d{4}_/, ''
|
56
|
+
end
|
57
|
+
|
58
|
+
def self.assert_runnable_methods_with_tags(tag_strings, expected_runnable_methods)
|
59
|
+
it "returns runnable_methods with tag_strings #{tag_strings.inspect}" do
|
60
|
+
stub_tags tag_strings do
|
61
|
+
TAGS_TEST
|
62
|
+
.runnable_methods
|
63
|
+
.map(&method(:strip_prefix))
|
64
|
+
.sort
|
65
|
+
.must_equal expected_runnable_methods
|
70
66
|
end
|
71
67
|
end
|
72
|
-
|
73
|
-
assert_runnable_methods_with_tags ['minitest_5'], %w[
|
74
|
-
1
|
75
|
-
2
|
76
|
-
]
|
77
|
-
|
78
|
-
assert_runnable_methods_with_tags ['~minitest_4'], %w[
|
79
|
-
1
|
80
|
-
2
|
81
|
-
5
|
82
|
-
6
|
83
|
-
7
|
84
|
-
]
|
85
|
-
|
86
|
-
assert_runnable_methods_with_tags ['specific:value'], %w[
|
87
|
-
5
|
88
|
-
6
|
89
|
-
7
|
90
|
-
]
|
91
|
-
|
92
|
-
assert_runnable_methods_with_tags ['~unmatched:value'], %w[
|
93
|
-
1
|
94
|
-
2
|
95
|
-
3
|
96
|
-
4
|
97
|
-
5
|
98
|
-
7
|
99
|
-
]
|
100
|
-
|
101
|
-
assert_runnable_methods_with_tags ['minitest_5', 'minitest_4', 'specific:value', '~unmatched:value', '~slow'], %w[
|
102
|
-
1
|
103
|
-
3
|
104
|
-
7
|
105
|
-
]
|
106
|
-
|
107
68
|
end
|
108
69
|
|
70
|
+
assert_runnable_methods_with_tags ['minitest_5'], %w[
|
71
|
+
1
|
72
|
+
2
|
73
|
+
]
|
74
|
+
|
75
|
+
assert_runnable_methods_with_tags ['~minitest_4'], %w[
|
76
|
+
1
|
77
|
+
2
|
78
|
+
5
|
79
|
+
6
|
80
|
+
7
|
81
|
+
]
|
82
|
+
|
83
|
+
assert_runnable_methods_with_tags ['specific:value'], %w[
|
84
|
+
5
|
85
|
+
6
|
86
|
+
7
|
87
|
+
]
|
88
|
+
|
89
|
+
assert_runnable_methods_with_tags ['~unmatched:value'], %w[
|
90
|
+
1
|
91
|
+
2
|
92
|
+
3
|
93
|
+
4
|
94
|
+
5
|
95
|
+
7
|
96
|
+
]
|
97
|
+
|
98
|
+
assert_runnable_methods_with_tags ['minitest_5', 'minitest_4', 'specific:value', '~unmatched:value', '~slow'], %w[
|
99
|
+
1
|
100
|
+
3
|
101
|
+
7
|
102
|
+
]
|
103
|
+
|
109
104
|
end
|
105
|
+
|
110
106
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: minispec-metadata
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jared Ning
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-08-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|
@@ -52,7 +52,7 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
-
description:
|
55
|
+
description: Minitest::Spec metadata
|
56
56
|
email:
|
57
57
|
- jared@redningja.com
|
58
58
|
executables: []
|
@@ -61,14 +61,12 @@ extra_rdoc_files: []
|
|
61
61
|
files:
|
62
62
|
- ".gitignore"
|
63
63
|
- ".ruby-version"
|
64
|
-
- ".travis.yml"
|
65
64
|
- CHANGELOG.md
|
66
65
|
- Gemfile
|
67
66
|
- LICENSE.txt
|
68
67
|
- README.md
|
69
68
|
- Rakefile
|
70
69
|
- gemfiles/minitest-4.gemfile
|
71
|
-
- lib/backwards.rb
|
72
70
|
- lib/minispec-metadata.rb
|
73
71
|
- lib/minispec-metadata/describe.rb
|
74
72
|
- lib/minispec-metadata/it.rb
|
@@ -76,7 +74,6 @@ files:
|
|
76
74
|
- lib/minispec-metadata/tags.rb
|
77
75
|
- lib/minispec-metadata/version.rb
|
78
76
|
- lib/minitest/minispec_metadata_plugin.rb
|
79
|
-
- lib/minitest/versions.rb
|
80
77
|
- minispec-metadata.gemspec
|
81
78
|
- spec/describe.spec.rb
|
82
79
|
- spec/helper.rb
|
@@ -89,7 +86,7 @@ homepage: https://github.com/ordinaryzelig/minispec-metadata
|
|
89
86
|
licenses:
|
90
87
|
- MIT
|
91
88
|
metadata: {}
|
92
|
-
post_install_message:
|
89
|
+
post_install_message:
|
93
90
|
rdoc_options: []
|
94
91
|
require_paths:
|
95
92
|
- lib
|
@@ -104,10 +101,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
104
101
|
- !ruby/object:Gem::Version
|
105
102
|
version: '0'
|
106
103
|
requirements: []
|
107
|
-
rubygems_version: 3.
|
108
|
-
signing_key:
|
104
|
+
rubygems_version: 3.3.7
|
105
|
+
signing_key:
|
109
106
|
specification_version: 4
|
110
|
-
summary: Pass metadata to
|
107
|
+
summary: Pass metadata to Minitest::Spec descriptions and specs like in RSpec.
|
111
108
|
test_files:
|
112
109
|
- spec/describe.spec.rb
|
113
110
|
- spec/helper.rb
|
data/.travis.yml
DELETED
data/lib/backwards.rb
DELETED