minitest-metadata 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +1 -2
- data/Gemfile.lock +3 -3
- data/HISTORY.md +6 -0
- data/README.md +8 -1
- data/lib/minitest/metadata/version.rb +1 -1
- data/lib/minitest/metadata.rb +12 -2
- data/minitest-metadata.gemspec +1 -1
- data/test/minitest-metadata_test.rb +3 -0
- metadata +13 -13
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
data/HISTORY.md
CHANGED
data/README.md
CHANGED
@@ -57,6 +57,13 @@ class UsersAcceptanceTest < AcceptanceTest
|
|
57
57
|
end
|
58
58
|
end
|
59
59
|
```
|
60
|
+
|
61
|
+
As in RSpec, [more compact syntax](https://www.relishapp.com/rspec/rspec-core/docs/metadata/user-defined-metadata#less-verbose-metadata) can be used:
|
62
|
+
|
63
|
+
```ruby
|
64
|
+
it "keyboard shortcuts pagination", :slow, :wip, :driver => :poltergeist
|
65
|
+
```
|
66
|
+
|
60
67
|
## Note about speed
|
61
68
|
|
62
69
|
minitest-metadata adds some overhead so you might want to limit it to only
|
@@ -96,7 +103,7 @@ gem 'minitest-metadata'
|
|
96
103
|
|
97
104
|
(The MIT License)
|
98
105
|
|
99
|
-
Copyright (c) 2012 Wojciech Mach
|
106
|
+
Copyright (c) 2012, 2013 Wojciech Mach
|
100
107
|
|
101
108
|
Permission is hereby granted, free of charge, to any person obtaining
|
102
109
|
a copy of this software and associated documentation files (the
|
data/lib/minitest/metadata.rb
CHANGED
@@ -14,11 +14,21 @@ module MiniTest::Metadata
|
|
14
14
|
alias :old_it :it
|
15
15
|
|
16
16
|
# @private
|
17
|
-
def it(description = "", metadata
|
17
|
+
def it(description = "", *metadata, &block)
|
18
18
|
old_it(description, &block).tap do |name|
|
19
|
-
self.metadata[name] = metadata
|
19
|
+
self.metadata[name] = _compute_metadata(metadata)
|
20
20
|
end
|
21
21
|
end
|
22
|
+
|
23
|
+
def _compute_metadata(metadata)
|
24
|
+
metadata.each_with_object({}) { |key, hash|
|
25
|
+
if key.is_a?(Hash)
|
26
|
+
hash.merge!(key)
|
27
|
+
else
|
28
|
+
hash[key] = true
|
29
|
+
end
|
30
|
+
}
|
31
|
+
end
|
22
32
|
end
|
23
33
|
end
|
24
34
|
super
|
data/minitest-metadata.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
|
|
18
18
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
19
|
s.require_paths = ["lib"]
|
20
20
|
|
21
|
-
s.add_dependency "minitest", "
|
21
|
+
s.add_dependency "minitest", "~> 4.7"
|
22
22
|
|
23
23
|
s.add_development_dependency "rake"
|
24
24
|
end
|
@@ -13,11 +13,14 @@ describe MiniTest::Spec do
|
|
13
13
|
it "test2" do; end
|
14
14
|
|
15
15
|
it "test3", :js => false do; end
|
16
|
+
|
17
|
+
it "test4", :vcr, :js => false do; end
|
16
18
|
end
|
17
19
|
|
18
20
|
@cls.metadata["test_0001_test1"].must_equal :js => true
|
19
21
|
@cls.metadata["test_0002_test2"].must_equal({})
|
20
22
|
@cls.metadata["test_0003_test3"].must_equal :js => false
|
23
|
+
@cls.metadata["test_0004_test4"].must_equal :vcr => true, :js => false
|
21
24
|
end
|
22
25
|
|
23
26
|
it "#meta returns empty hash when nothing passed to ::it" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: minitest-metadata
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,30 +9,30 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-04-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: minitest
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
|
-
- -
|
19
|
+
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: '
|
21
|
+
version: '4.7'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
none: false
|
26
26
|
requirements:
|
27
|
-
- -
|
27
|
+
- - ~>
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: '
|
29
|
+
version: '4.7'
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
name: rake
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
33
33
|
none: false
|
34
34
|
requirements:
|
35
|
-
- -
|
35
|
+
- - '>='
|
36
36
|
- !ruby/object:Gem::Version
|
37
37
|
version: '0'
|
38
38
|
type: :development
|
@@ -40,7 +40,7 @@ dependencies:
|
|
40
40
|
version_requirements: !ruby/object:Gem::Requirement
|
41
41
|
none: false
|
42
42
|
requirements:
|
43
|
-
- -
|
43
|
+
- - '>='
|
44
44
|
- !ruby/object:Gem::Version
|
45
45
|
version: '0'
|
46
46
|
description: Metadata (key-value) support for minitest/spec
|
@@ -72,24 +72,24 @@ require_paths:
|
|
72
72
|
required_ruby_version: !ruby/object:Gem::Requirement
|
73
73
|
none: false
|
74
74
|
requirements:
|
75
|
-
- -
|
75
|
+
- - '>='
|
76
76
|
- !ruby/object:Gem::Version
|
77
77
|
version: '0'
|
78
78
|
segments:
|
79
79
|
- 0
|
80
|
-
hash:
|
80
|
+
hash: 2550979206973276031
|
81
81
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
82
82
|
none: false
|
83
83
|
requirements:
|
84
|
-
- -
|
84
|
+
- - '>='
|
85
85
|
- !ruby/object:Gem::Version
|
86
86
|
version: '0'
|
87
87
|
segments:
|
88
88
|
- 0
|
89
|
-
hash:
|
89
|
+
hash: 2550979206973276031
|
90
90
|
requirements: []
|
91
91
|
rubyforge_project: minitest-metadata
|
92
|
-
rubygems_version: 1.8.
|
92
|
+
rubygems_version: 1.8.25
|
93
93
|
signing_key:
|
94
94
|
specification_version: 3
|
95
95
|
summary: Metadata (key-value) support for minitest/spec
|