minitest-metadata 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,13 +1,13 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- minitest-metadata (0.1.0)
4
+ minitest-metadata (0.3.0)
5
5
  minitest (>= 2.12)
6
6
 
7
7
  GEM
8
8
  remote: http://rubygems.org/
9
9
  specs:
10
- minitest (2.12.0)
10
+ minitest (4.2.0)
11
11
  rake (0.9.2.2)
12
12
 
13
13
  PLATFORMS
data/HISTORY.md CHANGED
@@ -1,3 +1,9 @@
1
+ # HEAD
2
+
3
+ # 0.3.0
4
+
5
+ * Reorganize file structure, extract MiniTest::Metadata
6
+
1
7
  # 0.2.0
2
8
 
3
9
  * No need for calculation of test method name - @splattael
data/README.md CHANGED
@@ -57,7 +57,24 @@ class UsersAcceptanceTest < AcceptanceTest
57
57
  end
58
58
  end
59
59
  ```
60
+ ## Note about speed
60
61
 
62
+ minitest-metadata adds some overhead so you might want to limit it to only
63
+ acceptance specs. If that's the case do this:
64
+
65
+ ```ruby
66
+ # Gemfile
67
+
68
+ group :test do
69
+ gem 'minitest-metadata', :require => false
70
+ end
71
+
72
+ # test/acceptance_test_helper.rb
73
+
74
+ class AcceptanceTest < MiniTest::Spec
75
+ include MiniTest::Metadata
76
+ end
77
+ ```
61
78
 
62
79
  ## Requirements
63
80
 
@@ -1,27 +1,6 @@
1
- require 'minitest/spec'
2
-
3
- require 'minitest-metadata/version'
1
+ require 'minitest/metadata/version'
2
+ require 'minitest/metadata'
4
3
 
5
4
  class MiniTest::Spec
6
- # Returns Hash metadata for class' test methods
7
- def self.metadata
8
- @metadata ||= {}
9
- end
10
-
11
- # Returns Hash metadata for currently running test
12
- def metadata
13
- self.class.metadata[__name__] || {}
14
- end
15
-
16
- class << self
17
- # @private
18
- alias :old_it :it
19
-
20
- # @private
21
- def it(description = "", metadata = {}, &block)
22
- old_it(description, &block).tap do |name|
23
- self.metadata[name] = metadata
24
- end
25
- end
26
- end
5
+ include MiniTest::Metadata
27
6
  end
@@ -0,0 +1,31 @@
1
+ module MiniTest::Metadata
2
+ module ClassMethods
3
+ # Returns Hash metadata for class' test methods
4
+ def metadata
5
+ @metadata ||= {}
6
+ end
7
+ end
8
+
9
+ def self.included(klass)
10
+ klass.extend ClassMethods
11
+ klass.class_eval do
12
+ class << self
13
+ # @private
14
+ alias :old_it :it
15
+
16
+ # @private
17
+ def it(description = "", metadata = {}, &block)
18
+ old_it(description, &block).tap do |name|
19
+ self.metadata[name] = metadata
20
+ end
21
+ end
22
+ end
23
+ end
24
+ super
25
+ end
26
+
27
+ # Returns Hash metadata for currently running test
28
+ def metadata
29
+ self.class.metadata[__name__] || {}
30
+ end
31
+ end
@@ -1,5 +1,5 @@
1
1
  module MiniTest
2
2
  module Metadata
3
- VERSION = '0.2.0'
3
+ VERSION = '0.3.0'
4
4
  end
5
5
  end
@@ -1,6 +1,6 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  $:.push File.expand_path("../lib", __FILE__)
3
- require "minitest-metadata/version"
3
+ require "minitest/metadata/version"
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = "minitest-metadata"
@@ -1,9 +1,13 @@
1
1
  require "minitest/autorun"
2
- require "minitest-metadata"
2
+ require "minitest/metadata"
3
3
 
4
4
  describe MiniTest::Spec do
5
+ include MiniTest::Metadata
6
+
5
7
  it "::metadata returns metadata hash for each test method" do
6
8
  @cls = describe "A spec" do
9
+ include MiniTest::Metadata
10
+
7
11
  it "test1", :js => true do; end
8
12
 
9
13
  it "test2" do; end
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.2.0
4
+ version: 0.3.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-14 00:00:00.000000000 Z
12
+ date: 2012-11-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: minitest
@@ -59,7 +59,8 @@ files:
59
59
  - README.md
60
60
  - Rakefile
61
61
  - lib/minitest-metadata.rb
62
- - lib/minitest-metadata/version.rb
62
+ - lib/minitest/metadata.rb
63
+ - lib/minitest/metadata/version.rb
63
64
  - minitest-metadata.gemspec
64
65
  - test/minitest-metadata_test.rb
65
66
  homepage: ''
@@ -74,15 +75,21 @@ required_ruby_version: !ruby/object:Gem::Requirement
74
75
  - - ! '>='
75
76
  - !ruby/object:Gem::Version
76
77
  version: '0'
78
+ segments:
79
+ - 0
80
+ hash: -2385578600278812796
77
81
  required_rubygems_version: !ruby/object:Gem::Requirement
78
82
  none: false
79
83
  requirements:
80
84
  - - ! '>='
81
85
  - !ruby/object:Gem::Version
82
86
  version: '0'
87
+ segments:
88
+ - 0
89
+ hash: -2385578600278812796
83
90
  requirements: []
84
91
  rubyforge_project: minitest-metadata
85
- rubygems_version: 1.8.21
92
+ rubygems_version: 1.8.24
86
93
  signing_key:
87
94
  specification_version: 3
88
95
  summary: Metadata (key-value) support for minitest/spec