minispec-metadata 3.3.1 → 3.5.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 +4 -4
- data/.ruby-version +1 -1
- data/CHANGELOG.md +13 -0
- data/README.md +11 -15
- 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 +4 -4
- data/spec/describe.spec.rb +26 -34
- data/spec/helper.rb +1 -1
- data/spec/it.spec.rb +11 -11
- data/spec/minispec_metadata.spec.rb +4 -5
- data/spec/regression.spec.rb +3 -3
- data/spec/tags.spec.rb +90 -89
- metadata +17 -20
- 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: 1060bde642108c75e9aa68ed534f5628ba8eb077f821635c3218c2455688c825
|
4
|
+
data.tar.gz: 9917b7f019e4425e01c17a429f94350228ef3a9197400cb613f321dc83889305
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 86a661762ddb75c3cb5aff7aead7c55ad1bb2a92152b6038968bb38c0f97978492a5a053221432d895c1f4713d7ac2cb281b40880a119ad59911f0fc1f8f9776
|
7
|
+
data.tar.gz: d0e0e710513fdc9533014e385d6f67d9ba6df3cf97005aacb3c1b823cccf9b68c4a5187741af75f9fb5e6a6d36ae097052c4076c3a89f3e33a951804ec62fb9e
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby-
|
1
|
+
ruby-3.1.2
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,16 @@
|
|
1
|
+
## 3.5.0
|
2
|
+
|
3
|
+
* Use Minitest \_() syntax to get rid of deprecation warnings. (@The-Alchemist)
|
4
|
+
|
5
|
+
## 3.4
|
6
|
+
|
7
|
+
* Removed support for Ruby <2, Minitest <5.
|
8
|
+
* Convert remaining use of MiniTest to Minitest. (@manuelvanrijn)
|
9
|
+
|
10
|
+
## >3.2.1 <3.4
|
11
|
+
|
12
|
+
Lazily (not) documented here.
|
13
|
+
|
1
14
|
## 3.2.1
|
2
15
|
|
3
16
|
* Remove backwards compatibility for `__dir__`. (Thanks @brennovich for noticiing.)
|
data/README.md
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
Minispec::Metadata
|
2
2
|
==================
|
3
3
|
|
4
|
-
[](http://travis-ci.org/ordinaryzelig/minispec-metadata)
|
5
|
-
|
6
4
|
https://github.com/ordinaryzelig/minispec-metadata
|
7
5
|
|
8
6
|
## Usage
|
@@ -20,39 +18,39 @@ describe 'Usage', some: 'metadata' do
|
|
20
18
|
end
|
21
19
|
|
22
20
|
it 'defines a metadata method', more: 'metadata' do
|
23
|
-
metadata.must_equal(
|
21
|
+
_(metadata).must_equal(
|
24
22
|
some: 'metadata',
|
25
23
|
more: 'metadata',
|
26
24
|
)
|
27
25
|
end
|
28
26
|
|
29
27
|
it 'gives priority to closest metadata', some: 'different metadata' do
|
30
|
-
metadata.must_equal(
|
28
|
+
_(metadata).must_equal(
|
31
29
|
some: 'different metadata',
|
32
30
|
)
|
33
31
|
end
|
34
32
|
|
35
33
|
it 'provides a method to get the description of the spec' do
|
36
|
-
desc.must_equal 'provides a method to get the description of the spec'
|
34
|
+
_(desc).must_equal 'provides a method to get the description of the spec'
|
37
35
|
end
|
38
36
|
|
39
37
|
describe MinispecMetadata, 'additional description' do
|
40
38
|
|
41
39
|
it 'provides a method to get the descriptions' do
|
42
|
-
self.class.descs.must_equal [MinispecMetadata, 'additional description']
|
40
|
+
_(self.class.descs).must_equal [MinispecMetadata, 'additional description']
|
43
41
|
end
|
44
42
|
|
45
43
|
it 'provides a method to get only the additional description' do
|
46
|
-
self.class.additional_desc.must_equal ['additional description']
|
44
|
+
_(self.class.additional_desc).must_equal ['additional description']
|
47
45
|
end
|
48
46
|
|
49
47
|
it 'is not needed to get the described object' do
|
50
48
|
# This is built in to Minitest, you don't need this gem to do this.
|
51
|
-
self.class.desc.must_equal MinispecMetadata
|
49
|
+
_(self.class.desc).must_equal MinispecMetadata
|
52
50
|
end
|
53
51
|
|
54
52
|
it 'treats additional descriptions as metadata too', meta: 'data' do
|
55
|
-
metadata.must_equal(
|
53
|
+
_(metadata).must_equal(
|
56
54
|
:some => 'metadata',
|
57
55
|
'additional description' => true,
|
58
56
|
:meta => 'data',
|
@@ -63,9 +61,9 @@ describe 'Usage', some: 'metadata' do
|
|
63
61
|
|
64
62
|
# Thanks to @mfpiccolo for this.
|
65
63
|
it 'allows array of symbols like RSpec', :these, :work, :too do
|
66
|
-
metadata[:these].must_equal true
|
67
|
-
metadata[:work].must_equal true
|
68
|
-
metadata[:too].must_equal true
|
64
|
+
_(metadata[:these]).must_equal true
|
65
|
+
_(metadata[:work]).must_equal true
|
66
|
+
_(metadata[:too]).must_equal true
|
69
67
|
end
|
70
68
|
|
71
69
|
end
|
@@ -133,6 +131,4 @@ Whatever path you decide to take, do this AFTER you've taken those steps:
|
|
133
131
|
|
134
132
|
## Compatibility
|
135
133
|
|
136
|
-
Tested with Minitest
|
137
|
-
Might work with older versions but I haven't tested them.
|
138
|
-
See .travis for more info.
|
134
|
+
Tested with Minitest 5, Ruby version 3, Rails version 5.1.
|
@@ -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
|
|
@@ -20,6 +20,6 @@ Gem::Specification.new do |gem|
|
|
20
20
|
|
21
21
|
gem.add_dependency 'minitest'
|
22
22
|
|
23
|
-
gem.add_development_dependency '
|
24
|
-
gem.add_development_dependency 'rake'
|
23
|
+
gem.add_development_dependency 'amazing_print', '~>1.5.0'
|
24
|
+
gem.add_development_dependency 'rake', '~>13.0.6'
|
25
25
|
end
|
data/spec/describe.spec.rb
CHANGED
@@ -5,7 +5,7 @@ describe MinispecMetadata::Describe, super_meta: 'data' do
|
|
5
5
|
describe 'as 2nd arg after description', second: '2nd' do
|
6
6
|
|
7
7
|
it 'is accessible with metadata method' do
|
8
|
-
metadata.fetch(:second).must_equal '2nd'
|
8
|
+
_(metadata.fetch(:second)).must_equal '2nd'
|
9
9
|
end
|
10
10
|
|
11
11
|
end
|
@@ -13,23 +13,23 @@ describe MinispecMetadata::Describe, super_meta: 'data' do
|
|
13
13
|
describe 'as 3rd arg after additional description', 'more description', third: '3rd' do
|
14
14
|
|
15
15
|
it 'is accessible with metadata method' do
|
16
|
-
metadata.fetch(:third).must_equal '3rd'
|
16
|
+
_(metadata.fetch(:third)).must_equal '3rd'
|
17
17
|
end
|
18
18
|
|
19
19
|
end
|
20
20
|
|
21
21
|
describe 'when just a symbol is passed', :axiom, :vcr do
|
22
22
|
it 'uses symbols as true values' do
|
23
|
-
metadata.fetch(:axiom).must_equal true
|
24
|
-
metadata.fetch(:vcr).must_equal true
|
23
|
+
_(metadata.fetch(:axiom)).must_equal true
|
24
|
+
_(metadata.fetch(:vcr)).must_equal true
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
28
|
describe 'duplicate', first: '1st' do
|
29
29
|
|
30
30
|
it 'correctly scopes metadata to current description' do
|
31
|
-
metadata.must_equal(first: '1st', super_meta: 'data')
|
32
|
-
metadata.key?(:second).must_equal false
|
31
|
+
_(metadata).must_equal(first: '1st', super_meta: 'data')
|
32
|
+
_(metadata.key?(:second)).must_equal false
|
33
33
|
end
|
34
34
|
|
35
35
|
end
|
@@ -37,8 +37,8 @@ describe MinispecMetadata::Describe, super_meta: 'data' do
|
|
37
37
|
describe 'duplicate', second: '2nd' do
|
38
38
|
|
39
39
|
it 'correctly scopes metadata to current description' do
|
40
|
-
metadata.must_equal(second: '2nd', super_meta: 'data')
|
41
|
-
metadata.key?(:first).must_equal false
|
40
|
+
_(metadata).must_equal(second: '2nd', super_meta: 'data')
|
41
|
+
_(metadata.key?(:first)).must_equal false
|
42
42
|
end
|
43
43
|
|
44
44
|
end
|
@@ -46,7 +46,7 @@ describe MinispecMetadata::Describe, super_meta: 'data' do
|
|
46
46
|
describe 'nested', sub: 'desc' do
|
47
47
|
|
48
48
|
it 'inherits from surrounding description', lowest: 'totem' do
|
49
|
-
metadata.must_equal(
|
49
|
+
_(metadata).must_equal(
|
50
50
|
super_meta: 'data',
|
51
51
|
sub: 'desc',
|
52
52
|
lowest: 'totem',
|
@@ -54,7 +54,7 @@ describe MinispecMetadata::Describe, super_meta: 'data' do
|
|
54
54
|
end
|
55
55
|
|
56
56
|
it 'gives nearest metadata priority', sub: 'zero', super_meta: 'priority' do
|
57
|
-
metadata.must_equal(
|
57
|
+
_(metadata).must_equal(
|
58
58
|
sub: 'zero',
|
59
59
|
super_meta: 'priority',
|
60
60
|
)
|
@@ -65,7 +65,7 @@ describe MinispecMetadata::Describe, super_meta: 'data' do
|
|
65
65
|
desc_class = describe 'return value' do
|
66
66
|
|
67
67
|
it 'equals description class' do
|
68
|
-
desc_class.must_equal self.class
|
68
|
+
_(desc_class).must_equal self.class
|
69
69
|
end
|
70
70
|
|
71
71
|
end
|
@@ -76,38 +76,34 @@ end
|
|
76
76
|
describe MinispecMetadata::Describe, 'additional description' do
|
77
77
|
|
78
78
|
it 'provides a method to get the descriptions' do
|
79
|
-
self.class.descs.must_equal [MinispecMetadata::Describe, 'additional description']
|
79
|
+
_(self.class.descs).must_equal [MinispecMetadata::Describe, 'additional description']
|
80
80
|
end
|
81
81
|
|
82
82
|
it 'provides a method to get only the additional description' do
|
83
|
-
self.class.additional_desc.must_equal ['additional description']
|
83
|
+
_(self.class.additional_desc).must_equal ['additional description']
|
84
84
|
end
|
85
85
|
|
86
86
|
describe 'nested describe with no additional description' do
|
87
87
|
|
88
88
|
it 'does not inherit additional description from parent' do
|
89
|
-
self.class.additional_desc.must_be_empty
|
89
|
+
_(self.class.additional_desc).must_be_empty
|
90
90
|
end
|
91
91
|
|
92
92
|
end
|
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,12 +111,8 @@ end
|
|
115
111
|
describe MinispecMetadata::Describe, 'additional description', :respect do
|
116
112
|
|
117
113
|
it 'respects additional description' do
|
118
|
-
|
119
|
-
|
120
|
-
else
|
121
|
-
self.class.name.must_equal 'MinispecMetadata::Describe::additional description::respect'
|
122
|
-
end
|
123
|
-
metadata.must_equal(
|
114
|
+
_(self.class.name).must_equal 'MinispecMetadata::Describe::additional description::respect'
|
115
|
+
_(metadata).must_equal(
|
124
116
|
'additional description' => true,
|
125
117
|
:respect => true,
|
126
118
|
)
|
data/spec/helper.rb
CHANGED
data/spec/it.spec.rb
CHANGED
@@ -3,25 +3,25 @@ require_relative 'helper'
|
|
3
3
|
describe MinispecMetadata::It do
|
4
4
|
|
5
5
|
it 'stores metadata for current spec', meta: 'data' do
|
6
|
-
metadata.fetch(:meta).must_equal 'data'
|
6
|
+
_(metadata.fetch(:meta)).must_equal 'data'
|
7
7
|
end
|
8
8
|
|
9
9
|
specify 'it works with #specify', 1 => 2 do
|
10
|
-
metadata.fetch(1).must_equal 2
|
10
|
+
_(metadata.fetch(1)).must_equal 2
|
11
11
|
end
|
12
12
|
|
13
13
|
it 'returns empty hash when no metadata set' do
|
14
|
-
metadata.must_equal({})
|
14
|
+
_(metadata).must_equal({})
|
15
15
|
end
|
16
16
|
|
17
17
|
name = it 'returns name' do
|
18
|
-
name.must_match /test_/
|
18
|
+
_(name).must_match %r/test_/
|
19
19
|
end
|
20
20
|
|
21
21
|
describe 'before/after hooks' do
|
22
22
|
|
23
23
|
before do
|
24
|
-
metadata.fetch(:before).must_equal 'accessible'
|
24
|
+
_(metadata.fetch(:before)).must_equal 'accessible'
|
25
25
|
end
|
26
26
|
|
27
27
|
it 'is accessible in hooks', before: 'accessible', after: 'also accessible' do
|
@@ -29,7 +29,7 @@ describe MinispecMetadata::It do
|
|
29
29
|
end
|
30
30
|
|
31
31
|
after do
|
32
|
-
metadata.fetch(:after).must_equal 'also accessible'
|
32
|
+
_(metadata.fetch(:after)).must_equal 'also accessible'
|
33
33
|
end
|
34
34
|
|
35
35
|
end
|
@@ -37,11 +37,11 @@ describe MinispecMetadata::It do
|
|
37
37
|
describe 'with description metadata', description_meta: 'data' do
|
38
38
|
|
39
39
|
it 'inherits metadata from description' do
|
40
|
-
metadata.fetch(:description_meta).must_equal 'data'
|
40
|
+
_(metadata.fetch(:description_meta)).must_equal 'data'
|
41
41
|
end
|
42
42
|
|
43
43
|
it "uses symbols as true values", :verity, :words_are_hard do
|
44
|
-
metadata.must_equal(
|
44
|
+
_(metadata).must_equal(
|
45
45
|
description_meta: 'data',
|
46
46
|
verity: true,
|
47
47
|
words_are_hard: true,
|
@@ -51,7 +51,7 @@ describe MinispecMetadata::It do
|
|
51
51
|
describe 'in a nested describe', 'with no metadata' do
|
52
52
|
|
53
53
|
it 'works', works: true do
|
54
|
-
metadata.must_equal(
|
54
|
+
_(metadata).must_equal(
|
55
55
|
:description_meta => 'data',
|
56
56
|
'with no metadata' => true,
|
57
57
|
:works => true,
|
@@ -63,7 +63,7 @@ describe MinispecMetadata::It do
|
|
63
63
|
describe 'in a nested describe', with_metadata: true do
|
64
64
|
|
65
65
|
it 'works', works: true do
|
66
|
-
metadata.must_equal(works: true, with_metadata: true, description_meta: 'data')
|
66
|
+
_(metadata).must_equal(works: true, with_metadata: true, description_meta: 'data')
|
67
67
|
end
|
68
68
|
|
69
69
|
end
|
@@ -75,7 +75,7 @@ end
|
|
75
75
|
describe MinispecMetadata::It, '#desc' do
|
76
76
|
|
77
77
|
it 'provides a method to get the name of the spec' do
|
78
|
-
desc.must_equal 'provides a method to get the name of the spec'
|
78
|
+
_(desc).must_equal 'provides a method to get the name of the spec'
|
79
79
|
end
|
80
80
|
|
81
81
|
end
|
@@ -6,23 +6,22 @@ describe MinispecMetadata do
|
|
6
6
|
|
7
7
|
it 'extracts from a hash' do
|
8
8
|
metadata = MinispecMetadata.extract_metadata [{asdf: true}]
|
9
|
-
metadata.must_equal asdf: true
|
9
|
+
_(metadata).must_equal asdf: true
|
10
10
|
end
|
11
11
|
|
12
12
|
it 'extracts from symbols, returns hash keys with true values' do
|
13
13
|
metadata = MinispecMetadata.extract_metadata [:asdf, :fdsa]
|
14
|
-
metadata.must_equal asdf: true, fdsa: true
|
14
|
+
_(metadata).must_equal asdf: true, fdsa: true
|
15
15
|
end
|
16
16
|
|
17
17
|
it 'extracts a mix' do
|
18
18
|
metadata = MinispecMetadata.extract_metadata [:asdf, {fdsa: true}]
|
19
|
-
metadata.must_equal asdf: true, fdsa: true
|
19
|
+
_(metadata).must_equal asdf: true, fdsa: true
|
20
20
|
end
|
21
21
|
|
22
22
|
it 'does not remove metadata from args' do
|
23
23
|
args = [:asdf, 'description']
|
24
|
-
|
25
|
-
args.must_equal [:asdf, 'description']
|
24
|
+
_(args).must_equal [:asdf, 'description']
|
26
25
|
end
|
27
26
|
|
28
27
|
end
|
data/spec/regression.spec.rb
CHANGED
@@ -5,14 +5,14 @@ require_relative 'helper'
|
|
5
5
|
describe "top level describe" do
|
6
6
|
describe "an inner describe" do
|
7
7
|
before do
|
8
|
-
desc.wont_be_nil
|
8
|
+
_(desc).wont_be_nil
|
9
9
|
end
|
10
10
|
it "an example inside inner describe" do
|
11
|
-
desc.must_equal 'an example inside inner describe'
|
11
|
+
_(desc).must_equal 'an example inside inner describe'
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
15
|
it "another top level example" do
|
16
|
-
desc.must_equal 'another top level example'
|
16
|
+
_(desc).must_equal 'another top level example'
|
17
17
|
end
|
18
18
|
end
|
data/spec/tags.spec.rb
CHANGED
@@ -1,110 +1,111 @@
|
|
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
|
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
|
14
11
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
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
|
20
17
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
18
|
+
it 'captures inclusivity' do
|
19
|
+
tag = Tag.new('sure')
|
20
|
+
_(tag).must_be :inclusive?
|
21
|
+
end
|
25
22
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
23
|
+
it 'captures exclusivity' do
|
24
|
+
tag = Tag.new('~sure')
|
25
|
+
_(tag).must_be :exclusive?
|
26
|
+
end
|
30
27
|
|
28
|
+
it 'captures exclusivity' do
|
29
|
+
tag = Tag.new('~sure')
|
30
|
+
_(tag).must_be :exclusive?
|
31
31
|
end
|
32
32
|
|
33
|
-
|
34
|
-
def self.passing_test(*args)
|
35
|
-
it *args do
|
36
|
-
pass
|
37
|
-
end
|
38
|
-
end
|
33
|
+
end
|
39
34
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
passing_test '6', 'specific' => :value, unmatched: :value
|
46
|
-
passing_test '7', 'specific' => 'value'
|
35
|
+
TAGS_TEST = describe Tags do
|
36
|
+
def self.passing_test(*args)
|
37
|
+
it(*args) do
|
38
|
+
pass
|
39
|
+
end
|
47
40
|
end
|
48
41
|
|
49
|
-
|
50
|
-
|
42
|
+
passing_test '1', :minitest_5
|
43
|
+
passing_test '2', 'minitest_5', :slow
|
44
|
+
passing_test '3', :minitest_4
|
45
|
+
passing_test '4', :minitest_4, 'slow'
|
46
|
+
passing_test '5', :slow, specific: 'value'
|
47
|
+
passing_test '6', 'specific' => :value, unmatched: :value
|
48
|
+
passing_test '7', 'specific' => 'value'
|
49
|
+
end
|
51
50
|
|
52
|
-
|
53
|
-
|
54
|
-
MinispecMetadata.stub :tags, tags, &block
|
55
|
-
end
|
51
|
+
# Test the #runnable_methods of tags_test above with different sets of Tags.
|
52
|
+
describe '#runnable_methods' do
|
56
53
|
|
57
|
-
|
58
|
-
|
59
|
-
|
54
|
+
def stub_tags(tag_strings, &block)
|
55
|
+
tags = tag_strings.map { |tag_string| Tag.new(tag_string) }
|
56
|
+
MinispecMetadata.stub :tags, tags, &block
|
57
|
+
end
|
60
58
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
59
|
+
def strip_prefix(name)
|
60
|
+
name.sub %r/^test_\d{4}_/, ''
|
61
|
+
end
|
62
|
+
|
63
|
+
def self.assert_runnable_methods_with_tags(tag_strings, expected_runnable_methods)
|
64
|
+
it "returns runnable_methods with tag_strings #{tag_strings.inspect}" do
|
65
|
+
stub_tags tag_strings do
|
66
|
+
_(TAGS_TEST
|
67
|
+
.runnable_methods
|
68
|
+
.map(&method(:strip_prefix))
|
69
|
+
.sort)
|
70
|
+
.must_equal expected_runnable_methods
|
70
71
|
end
|
71
72
|
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
73
|
end
|
108
74
|
|
75
|
+
assert_runnable_methods_with_tags ['minitest_5'], %w[
|
76
|
+
1
|
77
|
+
2
|
78
|
+
]
|
79
|
+
|
80
|
+
assert_runnable_methods_with_tags ['~minitest_4'], %w[
|
81
|
+
1
|
82
|
+
2
|
83
|
+
5
|
84
|
+
6
|
85
|
+
7
|
86
|
+
]
|
87
|
+
|
88
|
+
assert_runnable_methods_with_tags ['specific:value'], %w[
|
89
|
+
5
|
90
|
+
6
|
91
|
+
7
|
92
|
+
]
|
93
|
+
|
94
|
+
assert_runnable_methods_with_tags ['~unmatched:value'], %w[
|
95
|
+
1
|
96
|
+
2
|
97
|
+
3
|
98
|
+
4
|
99
|
+
5
|
100
|
+
7
|
101
|
+
]
|
102
|
+
|
103
|
+
assert_runnable_methods_with_tags ['minitest_5', 'minitest_4', 'specific:value', '~unmatched:value', '~slow'], %w[
|
104
|
+
1
|
105
|
+
3
|
106
|
+
7
|
107
|
+
]
|
108
|
+
|
109
109
|
end
|
110
|
+
|
110
111
|
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.5.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
|
@@ -25,34 +25,34 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: amazing_print
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 1.5.0
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 1.5.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 13.0.6
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
55
|
-
description:
|
54
|
+
version: 13.0.6
|
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