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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e8888a20b66167ab78f2470c84128998476160097cf5861f1fdd47a4c9538dad
4
- data.tar.gz: 45d1eeee75ba4b53ca8603f9b71297911282c902ab515b145dca5cad048b2ae7
3
+ metadata.gz: fcf3ae82eebf144b14585e96d430354d7e824727cb10e02100d1a576558fca70
4
+ data.tar.gz: 3908d4ead4dee7666ad65249a30d0f6120ee7c5efc08955187bf024c887e004f
5
5
  SHA512:
6
- metadata.gz: 144c57d7814be3b2dfa17d6ed35446ace5f4414dc6682ccb611dc1fe969c13d7f6a7e43e34ecb479377b7522494f29d4edadcce9fa75c9efab4515d653a64dd3
7
- data.tar.gz: 7d247cd6edbcece22f4b7960d4d2ba02bd41f60958eef03523e09ebe2433baf0e1dbe2d73a636e3d0e2aa7999c29938a417c60d5f7e205fd956112b7b53188a9
6
+ metadata.gz: 728712fdd55284feb128f7ad277182e78a14b435346737abf39a24e334c89f8d55b5a0503a9413c7e78b8eed471f4368ef10afea054780f601236b913a1fd288
7
+ data.tar.gz: 74a9176e4c69e7e430eebd94ceb120a57c501c4b379b16e3a5f8a6f95b0120ccc4810125d83237974cbe4b6f9c0a3cf456dfadea7c23a1e1550c2090f1cf761e
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- ruby-2.4.0
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
@@ -1,8 +1,6 @@
1
1
  Minispec::Metadata
2
2
  ==================
3
3
 
4
- [![Build Status](https://secure.travis-ci.org/ordinaryzelig/minispec-metadata.png?branch=master)](http://travis-ci.org/ordinaryzelig/minispec-metadata)
5
-
6
4
  https://github.com/ordinaryzelig/minispec-metadata
7
5
 
8
6
  ## Usage
@@ -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
- # Minitest 5 allows unlimited additional_desc.
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
- if MinispecMetadata.supports_tags?
106
- Minitest::Test.singleton_class.send :prepend, MinispecMetadata::Tags
107
- end
91
+ Minitest::Test.singleton_class.send :prepend, MinispecMetadata::Tags
@@ -1,3 +1,3 @@
1
1
  module MinispecMetadata
2
- VERSION = "3.3.1"
2
+ VERSION = "3.4.0"
3
3
  end
@@ -1,8 +1,5 @@
1
1
  require 'minitest/spec'
2
2
 
3
- require 'minitest/versions'
4
- require_relative 'backwards'
5
-
6
3
  require 'minispec-metadata/version'
7
4
 
8
5
  require 'minispec-metadata/it'
@@ -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{MiniTest::Spec metadata}
12
- gem.summary = %q{Pass metadata to MiniTest::Spec descriptions and specs like in RSpec.}
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
 
@@ -93,21 +93,17 @@ describe MinispecMetadata::Describe, 'additional description' do
93
93
 
94
94
  end
95
95
 
96
- if Minitest::Versions::MAJOR >= 5
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
- if Minitest::Versions::MAJOR <= 4
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
@@ -5,6 +5,6 @@ require 'minitest/autorun'
5
5
  require 'minitest/pride'
6
6
  require 'minispec-metadata'
7
7
 
8
- class MiniTest::Unit::TestCase
8
+ class Minitest::Unit::TestCase
9
9
  parallelize_me!
10
10
  end
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
- if MinispecMetadata.supports_tags?
3
+ module MinispecMetadata
4
+ describe Tag do
5
5
 
6
- module MinispecMetadata
7
- describe Tag do
8
-
9
- it 'captures the metadata key' do
10
- tag = Tag.new('~sure')
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
- it 'captures inclusivity' do
22
- tag = Tag.new('sure')
23
- tag.must_be :inclusive?
24
- end
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
- it 'captures exclusivity' do
27
- tag = Tag.new('~sure')
28
- tag.must_be :exclusive?
29
- end
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
- TAGS_TEST = describe Tags do
34
- def self.passing_test(*args)
35
- it *args do
36
- pass
37
- end
38
- end
28
+ end
39
29
 
40
- passing_test '1', :minitest_5
41
- passing_test '2', 'minitest_5', :slow
42
- passing_test '3', :minitest_4
43
- passing_test '4', :minitest_4, 'slow'
44
- passing_test '5', :slow, specific: 'value'
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
- # Test the #runnable_methods of tags_test above with different sets of Tags.
50
- describe '#runnable_methods' do
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
- def stub_tags(tag_strings, &block)
53
- tags = tag_strings.map { |tag_string| Tag.new(tag_string) }
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
- def strip_prefix(name)
58
- name.sub /^test_\d{4}_/, ''
59
- end
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
- def self.assert_runnable_methods_with_tags(tag_strings, expected_runnable_methods)
62
- it "returns runnable_methods with tag_strings #{tag_strings.inspect}" do
63
- stub_tags tag_strings do
64
- TAGS_TEST
65
- .runnable_methods
66
- .map(&method(:strip_prefix))
67
- .sort
68
- .must_equal expected_runnable_methods
69
- end
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.3.1
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: 2019-06-11 00:00:00.000000000 Z
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: MiniTest::Spec metadata
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.0.3
108
- signing_key:
104
+ rubygems_version: 3.3.7
105
+ signing_key:
109
106
  specification_version: 4
110
- summary: Pass metadata to MiniTest::Spec descriptions and specs like in RSpec.
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
@@ -1,12 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.0.0
4
- - 2.1.2
5
- - 2.2.2
6
- - 2.4.1
7
-
8
- script: bundle exec rake
9
-
10
- gemfile:
11
- - Gemfile
12
- - gemfiles/minitest-4.gemfile
data/lib/backwards.rb DELETED
@@ -1,9 +0,0 @@
1
- # For a bit of backward compatibility.
2
- # Thanks to @jhsu for discovering the discrepancy.
3
- if Minitest::Versions::MAJOR <= 4
4
- class MiniTest::Unit::TestCase
5
- def name
6
- __name__
7
- end
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- module Minitest
2
-
3
- module Versions
4
-
5
- MAJOR, MINOR, PATCH = Minitest::Unit::VERSION.split('.').map(&:to_i)
6
-
7
- end
8
-
9
- end