minitest-tags 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile ADDED
@@ -0,0 +1,10 @@
1
+ source :gemcutter
2
+
3
+ group :production do
4
+ gem "minitest", "2.2.2"
5
+ gem "minitest-tags"
6
+ end
7
+
8
+ group :develoment do
9
+ gem "ruby-debug19"
10
+ end
@@ -0,0 +1,27 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ archive-tar-minitar (0.5.2)
5
+ columnize (0.3.2)
6
+ linecache19 (0.5.12)
7
+ ruby_core_source (>= 0.1.4)
8
+ minitest (2.2.2)
9
+ minitest-tags (0.0.2)
10
+ ruby-debug-base19 (0.11.25)
11
+ columnize (>= 0.3.1)
12
+ linecache19 (>= 0.5.11)
13
+ ruby_core_source (>= 0.1.4)
14
+ ruby-debug19 (0.11.6)
15
+ columnize (>= 0.3.1)
16
+ linecache19 (>= 0.5.11)
17
+ ruby-debug-base19 (>= 0.11.19)
18
+ ruby_core_source (0.1.5)
19
+ archive-tar-minitar (>= 0.5.2)
20
+
21
+ PLATFORMS
22
+ ruby
23
+
24
+ DEPENDENCIES
25
+ minitest (= 2.2.2)
26
+ minitest-tags
27
+ ruby-debug19
data/README ADDED
@@ -0,0 +1,7 @@
1
+ please take a look at Rakefile, Gemfile, and test/helper.rb. that's it, right?
2
+
3
+ rake test # run all test, just
4
+
5
+ rake test:on[follow] # only invoke the test case the desc inlcuding "follow" quoted by parenthesis
6
+
7
+ rake test:on[login] # only invoke the test case the desc inlcuding "login" quoted by parenthesis
@@ -0,0 +1,19 @@
1
+ # encoding: utf-8
2
+ require "rake/testtask"
3
+ require "bundler/setup"
4
+ Bundler.require :production
5
+
6
+ Rake::TestTask.new do |test|
7
+ test.libs << "feaure"
8
+ test.test_files = FileList["test/**/*_spec.rb"]
9
+ test.verbose = true
10
+ end
11
+
12
+ namespace :test do
13
+ desc "override the 'it' method to invoke the test case that marked by tag "
14
+ task :on, :tag do |t, args|
15
+ ENV["TAG"] = args[:tag]
16
+ Rake::Task[:test].invoke
17
+ end
18
+ end
19
+
@@ -0,0 +1,31 @@
1
+ module Minitest
2
+ module Tags
3
+ def self.included(base)
4
+ class << base
5
+ remove_method :it
6
+ end
7
+ base.extend ClassMethods
8
+ end
9
+
10
+ module ClassMethods
11
+ def it desc, &block
12
+ tags = desc.match(/\(([\s\S]+)\)/)[1].split(",").map(&:strip) if desc.match(/\(([\s\S]+)\)/)
13
+ tags = tags || []
14
+ tag = ENV["TAG"]
15
+ block = proc { skip "(only the desc including tag #{tag} available)" } unless tags.include?(tag)
16
+ block ||= proc { skip "(no tests defined)" }
17
+
18
+ @specs ||= 0
19
+ @specs += 1
20
+
21
+ name = "test_%04d_%s" % [ @specs, desc.gsub(/\W+/, '_').downcase ]
22
+
23
+ define_method name, &block
24
+
25
+ self.children.each do |mod|
26
+ mod.send :undef_method, name if mod.public_method_defined? name
27
+ end
28
+ end # it
29
+ end # ClassMethods
30
+ end #Tags
31
+ end #Minitest
@@ -0,0 +1,3 @@
1
+ module Minitest
2
+ VERSION = "0.0.4"
3
+ end
@@ -0,0 +1,16 @@
1
+ unless defined?(MiniTest)
2
+ begin
3
+ require "minitest/autorun"
4
+ rescue
5
+ require "rubygems"
6
+ require "minitest/autorun"
7
+ end
8
+ end
9
+
10
+ if ENV["TAG"]
11
+ require "minitest/tags"
12
+ class MiniTest::Spec
13
+ include Minitest::Tags
14
+ end
15
+ end
16
+
@@ -0,0 +1,25 @@
1
+ #-*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "minitest/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "minitest-tags"
7
+ s.version = Minitest::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ["wenbo", "Lorenzo Planas"]
10
+ s.email = ["yiyun6674@hotmail.com", "lplanas@qindio.com"]
11
+ s.homepage = ""
12
+ s.summary = %q{add tags for minitest}
13
+ s.description = <<-EOF
14
+ when you invode the it method that coming with Minitest::Spec,
15
+ you can tag a test case by the words that quoted by parenthesis, then
16
+ specify the tag at your rake task, and the test case related to this tag
17
+ will be invoked
18
+ EOF
19
+
20
+ s.add_development_dependency "minitest", "~>2.2.2"
21
+
22
+ s.files = `git ls-files`.split("\n")
23
+ s.test_files = `git ls-files -- {test}/*`.split("\n")
24
+ s.require_paths = ["lib"]
25
+ end
@@ -0,0 +1,14 @@
1
+ #encoding: utf-8
2
+ require_relative 'helper'
3
+ describe "foo" do
4
+
5
+ it "foo" do
6
+ true.must_equal true
7
+ end
8
+
9
+ it "dummy" do
10
+ true.must_equal true
11
+ end
12
+
13
+ end
14
+
@@ -0,0 +1,4 @@
1
+ require "bundler/setup"
2
+ Bundler.require :production
3
+ require "minitest/autorun"
4
+ require 'minitest_tags' if ENV["TAG"]
@@ -0,0 +1,13 @@
1
+ #encoding: utf-8
2
+ require_relative 'helper'
3
+ describe "TTTTTT" do
4
+ it "ttt(follow,login)" do
5
+ true.must_equal true
6
+ end
7
+
8
+ it "tttt doom(follow) " do
9
+ true.must_equal true
10
+ end
11
+
12
+ end
13
+
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: minitest-tags
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.3
5
+ version: 0.0.4
6
6
  platform: ruby
7
7
  authors:
8
8
  - wenbo
@@ -35,8 +35,18 @@ extensions: []
35
35
 
36
36
  extra_rdoc_files: []
37
37
 
38
- files: []
39
-
38
+ files:
39
+ - Gemfile
40
+ - Gemfile.lock
41
+ - README
42
+ - Rakefile
43
+ - lib/minitest/tags.rb
44
+ - lib/minitest/version.rb
45
+ - lib/minitest_tags.rb
46
+ - minitest-tags.gemspec
47
+ - test/foo_spec.rb
48
+ - test/helper.rb
49
+ - test/ttt_spec.rb
40
50
  has_rdoc: true
41
51
  homepage: ""
42
52
  licenses: []