minitest-focus 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data.tar.gz.sig +3 -0
- data/.autotest +26 -0
- data/.gemtest +0 -0
- data/History.txt +6 -0
- data/Manifest.txt +7 -0
- data/README.txt +65 -0
- data/Rakefile +16 -0
- data/lib/minitest/focus.rb +32 -0
- data/test/minitest/test_focus.rb +14 -0
- metadata +147 -0
- metadata.gz.sig +1 -0
data.tar.gz.sig
ADDED
data/.autotest
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# -*- ruby -*-
|
2
|
+
|
3
|
+
require "autotest/restart"
|
4
|
+
|
5
|
+
Autotest.add_hook :initialize do |at|
|
6
|
+
at.testlib = "minitest/autorun"
|
7
|
+
at.add_exception "tmp"
|
8
|
+
|
9
|
+
# at.extra_files << "../some/external/dependency.rb"
|
10
|
+
#
|
11
|
+
# at.libs << ":../some/external"
|
12
|
+
#
|
13
|
+
# at.add_exception "vendor"
|
14
|
+
#
|
15
|
+
# at.add_mapping(/dependency.rb/) do |f, _|
|
16
|
+
# at.files_matching(/test_.*rb$/)
|
17
|
+
# end
|
18
|
+
#
|
19
|
+
# %w(TestA TestB).each do |klass|
|
20
|
+
# at.extra_class_map[klass] = "test/test_misc.rb"
|
21
|
+
# end
|
22
|
+
end
|
23
|
+
|
24
|
+
# Autotest.add_hook :run_command do |at|
|
25
|
+
# system "rake build"
|
26
|
+
# end
|
data/.gemtest
ADDED
File without changes
|
data/History.txt
ADDED
data/Manifest.txt
ADDED
data/README.txt
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
= minitest-focus
|
2
|
+
|
3
|
+
home :: https://github.com/seattlerb/minitest-focus
|
4
|
+
rdoc :: http://docs.seattlerb.org/minitest-focus
|
5
|
+
|
6
|
+
== DESCRIPTION:
|
7
|
+
|
8
|
+
Allows you to focus on a few tests with ease without having to use
|
9
|
+
command-line arguments. Good for tools like guard that don't have
|
10
|
+
enough brains to understand test output. Cf. ZenTest's autotest (an
|
11
|
+
example of a test runner with strong testing logic).
|
12
|
+
|
13
|
+
Inspired by https://github.com/seattlerb/minitest/issues/213
|
14
|
+
|
15
|
+
== FEATURES/PROBLEMS:
|
16
|
+
|
17
|
+
* `focus` class method allows you to specify that the next test
|
18
|
+
defined should be run.
|
19
|
+
|
20
|
+
== SYNOPSIS:
|
21
|
+
|
22
|
+
require "minitest/autorun"
|
23
|
+
require "minitest/focus"
|
24
|
+
|
25
|
+
class MyTest < MiniTest::Unit::TestCase
|
26
|
+
def test_unrelated; ...; end
|
27
|
+
|
28
|
+
focus
|
29
|
+
def test_method; ...; end # only this one will run
|
30
|
+
|
31
|
+
def test_method_edgecase; ...; end
|
32
|
+
end
|
33
|
+
|
34
|
+
== REQUIREMENTS:
|
35
|
+
|
36
|
+
* minitest 4.3.4+
|
37
|
+
|
38
|
+
== INSTALL:
|
39
|
+
|
40
|
+
* sudo gem install minitest-focus
|
41
|
+
|
42
|
+
== LICENSE:
|
43
|
+
|
44
|
+
(The MIT License)
|
45
|
+
|
46
|
+
Copyright (c) Ryan Davis, seattle.rb
|
47
|
+
|
48
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
49
|
+
a copy of this software and associated documentation files (the
|
50
|
+
'Software'), to deal in the Software without restriction, including
|
51
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
52
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
53
|
+
permit persons to whom the Software is furnished to do so, subject to
|
54
|
+
the following conditions:
|
55
|
+
|
56
|
+
The above copyright notice and this permission notice shall be
|
57
|
+
included in all copies or substantial portions of the Software.
|
58
|
+
|
59
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
60
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
61
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
62
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
63
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
64
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
65
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
# -*- ruby -*-
|
2
|
+
|
3
|
+
require "rubygems"
|
4
|
+
require "hoe"
|
5
|
+
|
6
|
+
Hoe.plugin :isolate
|
7
|
+
Hoe.plugin :seattlerb
|
8
|
+
|
9
|
+
Hoe.spec "minitest-focus" do
|
10
|
+
developer "Ryan Davis", "ryand-ruby@zenspider.com"
|
11
|
+
license "MIT"
|
12
|
+
|
13
|
+
dependency "minitest", "~> 4.4"
|
14
|
+
end
|
15
|
+
|
16
|
+
# vim: syntax=ruby
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require "minitest/unit"
|
2
|
+
|
3
|
+
class MiniTest::Unit::TestCase # :nodoc:
|
4
|
+
class Focus # :nodoc:
|
5
|
+
VERSION = "1.0.0" # :nodoc:
|
6
|
+
end
|
7
|
+
|
8
|
+
##
|
9
|
+
# Focus on the next test defined. Cumulative. Equivalent to
|
10
|
+
# running with command line arg: -n /test_name|.../
|
11
|
+
#
|
12
|
+
# class MyTest < MiniTest::Unit::TestCase
|
13
|
+
# ...
|
14
|
+
# focus
|
15
|
+
# def test_pass; ... end # this one will run
|
16
|
+
# ...
|
17
|
+
# end
|
18
|
+
|
19
|
+
def self.focus
|
20
|
+
opts = MiniTest::Unit.runner.options
|
21
|
+
meta = class << self; self; end
|
22
|
+
|
23
|
+
opts[:names] ||= []
|
24
|
+
|
25
|
+
meta.send :define_method, :method_added do |name|
|
26
|
+
opts[:names] << name.to_s
|
27
|
+
opts[:filter] = "/^(#{opts[:names].join "|"})$/"
|
28
|
+
|
29
|
+
meta.send :remove_method, :method_added
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require "minitest/autorun"
|
2
|
+
require "minitest/focus"
|
3
|
+
|
4
|
+
class MyTest < MiniTest::Unit::TestCase
|
5
|
+
def test_fail; flunk; end
|
6
|
+
focus; def test_method; pass; end
|
7
|
+
def test_method_edgecase; flunk; end
|
8
|
+
end
|
9
|
+
|
10
|
+
describe MyTest do
|
11
|
+
it "is ignored" do flunk end
|
12
|
+
focus; it "does something" do pass end
|
13
|
+
it "bombs" do flunk end
|
14
|
+
end
|
metadata
ADDED
@@ -0,0 +1,147 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: minitest-focus
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 23
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 1
|
8
|
+
- 0
|
9
|
+
- 0
|
10
|
+
version: 1.0.0
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Ryan Davis
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain:
|
17
|
+
- |
|
18
|
+
-----BEGIN CERTIFICATE-----
|
19
|
+
MIIDPjCCAiagAwIBAgIBADANBgkqhkiG9w0BAQUFADBFMRMwEQYDVQQDDApyeWFu
|
20
|
+
ZC1ydWJ5MRkwFwYKCZImiZPyLGQBGRYJemVuc3BpZGVyMRMwEQYKCZImiZPyLGQB
|
21
|
+
GRYDY29tMB4XDTA5MDMwNjE4NTMxNVoXDTEwMDMwNjE4NTMxNVowRTETMBEGA1UE
|
22
|
+
AwwKcnlhbmQtcnVieTEZMBcGCgmSJomT8ixkARkWCXplbnNwaWRlcjETMBEGCgmS
|
23
|
+
JomT8ixkARkWA2NvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALda
|
24
|
+
b9DCgK+627gPJkB6XfjZ1itoOQvpqH1EXScSaba9/S2VF22VYQbXU1xQXL/WzCkx
|
25
|
+
taCPaLmfYIaFcHHCSY4hYDJijRQkLxPeB3xbOfzfLoBDbjvx5JxgJxUjmGa7xhcT
|
26
|
+
oOvjtt5P8+GSK9zLzxQP0gVLS/D0FmoE44XuDr3iQkVS2ujU5zZL84mMNqNB1znh
|
27
|
+
GiadM9GHRaDiaxuX0cIUBj19T01mVE2iymf9I6bEsiayK/n6QujtyCbTWsAS9Rqt
|
28
|
+
qhtV7HJxNKuPj/JFH0D2cswvzznE/a5FOYO68g+YCuFi5L8wZuuM8zzdwjrWHqSV
|
29
|
+
gBEfoTEGr7Zii72cx+sCAwEAAaM5MDcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAw
|
30
|
+
HQYDVR0OBBYEFEfFe9md/r/tj/Wmwpy+MI8d9k/hMA0GCSqGSIb3DQEBBQUAA4IB
|
31
|
+
AQAY59gYvDxqSqgC92nAP9P8dnGgfZgLxP237xS6XxFGJSghdz/nI6pusfCWKM8m
|
32
|
+
vzjjH2wUMSSf3tNudQ3rCGLf2epkcU13/rguI88wO6MrE0wi4ZqLQX+eZQFskJb/
|
33
|
+
w6x9W1ur8eR01s397LSMexySDBrJOh34cm2AlfKr/jokKCTwcM0OvVZnAutaovC0
|
34
|
+
l1SVZ0ecg88bsWHA0Yhh7NFxK1utWoIhtB6AFC/+trM0FQEB/jZkIS8SaNzn96Rl
|
35
|
+
n0sZEf77FLf5peR8TP/PtmIg7Cyqz23sLM4mCOoTGIy5OcZ8TdyiyINUHtb5ej/T
|
36
|
+
FBHgymkyj/AOSqKRIpXPhjC6
|
37
|
+
-----END CERTIFICATE-----
|
38
|
+
|
39
|
+
date: 2013-01-08 00:00:00 Z
|
40
|
+
dependencies:
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: minitest
|
43
|
+
prerelease: false
|
44
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
45
|
+
none: false
|
46
|
+
requirements:
|
47
|
+
- - ~>
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
hash: 19
|
50
|
+
segments:
|
51
|
+
- 4
|
52
|
+
- 4
|
53
|
+
version: "4.4"
|
54
|
+
type: :runtime
|
55
|
+
version_requirements: *id001
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: rdoc
|
58
|
+
prerelease: false
|
59
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
60
|
+
none: false
|
61
|
+
requirements:
|
62
|
+
- - ~>
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
hash: 19
|
65
|
+
segments:
|
66
|
+
- 3
|
67
|
+
- 10
|
68
|
+
version: "3.10"
|
69
|
+
type: :development
|
70
|
+
version_requirements: *id002
|
71
|
+
- !ruby/object:Gem::Dependency
|
72
|
+
name: hoe
|
73
|
+
prerelease: false
|
74
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
75
|
+
none: false
|
76
|
+
requirements:
|
77
|
+
- - ~>
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
hash: 15
|
80
|
+
segments:
|
81
|
+
- 3
|
82
|
+
- 4
|
83
|
+
version: "3.4"
|
84
|
+
type: :development
|
85
|
+
version_requirements: *id003
|
86
|
+
description: |-
|
87
|
+
Allows you to focus on a few tests with ease without having to use
|
88
|
+
command-line arguments. Good for tools like guard that don't have
|
89
|
+
enough brains to understand test output. Cf. ZenTest's autotest (an
|
90
|
+
example of a test runner with strong testing logic).
|
91
|
+
|
92
|
+
Inspired by https://github.com/seattlerb/minitest/issues/213
|
93
|
+
email:
|
94
|
+
- ryand-ruby@zenspider.com
|
95
|
+
executables: []
|
96
|
+
|
97
|
+
extensions: []
|
98
|
+
|
99
|
+
extra_rdoc_files:
|
100
|
+
- History.txt
|
101
|
+
- Manifest.txt
|
102
|
+
- README.txt
|
103
|
+
files:
|
104
|
+
- .autotest
|
105
|
+
- History.txt
|
106
|
+
- Manifest.txt
|
107
|
+
- README.txt
|
108
|
+
- Rakefile
|
109
|
+
- lib/minitest/focus.rb
|
110
|
+
- test/minitest/test_focus.rb
|
111
|
+
- .gemtest
|
112
|
+
homepage: https://github.com/seattlerb/minitest-focus
|
113
|
+
licenses:
|
114
|
+
- MIT
|
115
|
+
post_install_message:
|
116
|
+
rdoc_options:
|
117
|
+
- --main
|
118
|
+
- README.txt
|
119
|
+
require_paths:
|
120
|
+
- lib
|
121
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
122
|
+
none: false
|
123
|
+
requirements:
|
124
|
+
- - ">="
|
125
|
+
- !ruby/object:Gem::Version
|
126
|
+
hash: 3
|
127
|
+
segments:
|
128
|
+
- 0
|
129
|
+
version: "0"
|
130
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
131
|
+
none: false
|
132
|
+
requirements:
|
133
|
+
- - ">="
|
134
|
+
- !ruby/object:Gem::Version
|
135
|
+
hash: 3
|
136
|
+
segments:
|
137
|
+
- 0
|
138
|
+
version: "0"
|
139
|
+
requirements: []
|
140
|
+
|
141
|
+
rubyforge_project: minitest-focus
|
142
|
+
rubygems_version: 1.8.24
|
143
|
+
signing_key:
|
144
|
+
specification_version: 3
|
145
|
+
summary: Allows you to focus on a few tests with ease without having to use command-line arguments
|
146
|
+
test_files:
|
147
|
+
- test/minitest/test_focus.rb
|
metadata.gz.sig
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
-
|