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 CHANGED
@@ -1,7 +1,6 @@
1
1
  rvm:
2
- - 1.8.7
3
2
  - 1.9.2
4
3
  - 1.9.3
5
- - ree
4
+ - 2.0.0
6
5
  - jruby
7
6
  - rbx
data/Gemfile.lock CHANGED
@@ -1,13 +1,13 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- minitest-metadata (0.3.0)
5
- minitest (>= 2.12)
4
+ minitest-metadata (0.4.0)
5
+ minitest (~> 4.7)
6
6
 
7
7
  GEM
8
8
  remote: http://rubygems.org/
9
9
  specs:
10
- minitest (4.2.0)
10
+ minitest (4.7.1)
11
11
  rake (0.9.2.2)
12
12
 
13
13
  PLATFORMS
data/HISTORY.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # HEAD
2
2
 
3
+ # 0.4.0
4
+
5
+ * Add more compact syntax
6
+ * Dropping 1.8 & REE, and adding 2.0 support
7
+ * Depend on minitest ~> 4.7
8
+
3
9
  # 0.3.0
4
10
 
5
11
  * Reorganize file structure, extract MiniTest::Metadata
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
@@ -1,5 +1,5 @@
1
1
  module MiniTest
2
2
  module Metadata
3
- VERSION = '0.3.0'
3
+ VERSION = '0.4.0'
4
4
  end
5
5
  end
@@ -14,11 +14,21 @@ module MiniTest::Metadata
14
14
  alias :old_it :it
15
15
 
16
16
  # @private
17
- def it(description = "", metadata = {}, &block)
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
@@ -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", ">= 2.12"
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.3.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: 2012-11-14 00:00:00.000000000 Z
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: '2.12'
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: '2.12'
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: -2385578600278812796
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: -2385578600278812796
89
+ hash: 2550979206973276031
90
90
  requirements: []
91
91
  rubyforge_project: minitest-metadata
92
- rubygems_version: 1.8.24
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