guard-minitest 1.0.0.rc.2 → 1.0.0.rc.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +15 -1
- data/lib/guard/minitest/inspector.rb +17 -37
- data/lib/guard/minitest/runner.rb +21 -7
- data/lib/guard/minitest/version.rb +1 -1
- data/lib/minitest/guard_minitest_plugin.rb +6 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 62bede663636e879d9ff397f906ff30fe4ef3b76
|
4
|
+
data.tar.gz: e4e2b0a5f32a0a318bc7c4685b08a61f34837027
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8bedf120fee341516e402066089e4d4009f46880cc54e3d7fae27935ff163e308739c5c5d8ffbeb0e3f732a90ed28ffb5bb317c6d615b25904cfa547cd5004ea
|
7
|
+
data.tar.gz: 468176f1a886768246426c728fcc6a65167e06e36b51f8a02d5984d257e5bd6034a07ee6c7428c5be55f355e9060053e6f8f986361416f61d876013d48a6be83
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,17 @@
|
|
1
1
|
## Unreleased Changes
|
2
2
|
|
3
|
-
[Full Changelog](https://github.com/guard/guard-minitest/compare/v1.0.0.rc.
|
3
|
+
[Full Changelog](https://github.com/guard/guard-minitest/compare/v1.0.0.rc.3...master)
|
4
|
+
|
5
|
+
## 1.0.0.rc.3 - Jun 22, 2013
|
6
|
+
|
7
|
+
[Full Changelog](https://github.com/guard/guard-minitest/compare/v1.0.0.rc.2...v1.0.0.rc.3)
|
8
|
+
|
9
|
+
### Improvements
|
10
|
+
|
11
|
+
* [#70][] Use `-r minitest/autorun` instead of `-e 'Minitest.autorun'` in the runner. ([@kejadlen][])
|
12
|
+
* Refactor / simplify `Guard::Minitest::Inspector`. ([@rymai][])
|
13
|
+
* [#69][] Use `Gem::Requirement.new` to compare versions. ([@kejadlen][])
|
14
|
+
* [#68][] Remove the unused test directory. ([@kejadlen][])
|
4
15
|
|
5
16
|
## 1.0.0.rc.2 - Jun 19, 2013
|
6
17
|
|
@@ -143,6 +154,9 @@ First stable release.
|
|
143
154
|
[#62]: https://github.com/guard/guard/issues/62
|
144
155
|
[#65]: https://github.com/guard/guard/issues/65
|
145
156
|
[#66]: https://github.com/guard/guard/issues/66
|
157
|
+
[#68]: https://github.com/guard/guard/issues/68
|
158
|
+
[#69]: https://github.com/guard/guard/issues/69
|
159
|
+
[#70]: https://github.com/guard/guard/issues/70
|
146
160
|
[@aflock]: https://github.com/aflock
|
147
161
|
[@arronmabrey]: https://github.com/arronmabrey
|
148
162
|
[@aspiers]: https://github.com/aspiers
|
@@ -6,8 +6,8 @@ module Guard
|
|
6
6
|
attr_reader :test_folders, :test_file_patterns
|
7
7
|
|
8
8
|
def initialize(test_folders, test_file_patterns)
|
9
|
-
@test_folders = test_folders.uniq.compact
|
10
|
-
@test_file_patterns = test_file_patterns.uniq.compact
|
9
|
+
@test_folders = test_folders.uniq.compact
|
10
|
+
@test_file_patterns = test_file_patterns.uniq.compact
|
11
11
|
end
|
12
12
|
|
13
13
|
def clean_all
|
@@ -15,57 +15,37 @@ module Guard
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def clean(paths)
|
18
|
-
paths
|
19
|
-
paths = paths.select { |p| test_file?(p) || test_folder?(p) }
|
20
|
-
|
21
|
-
paths.dup.each do |path|
|
18
|
+
paths.reduce([]) do |memo, path|
|
22
19
|
if File.directory?(path)
|
23
|
-
|
24
|
-
|
20
|
+
memo += _test_files_for_paths(path)
|
21
|
+
else
|
22
|
+
memo << path if _test_file?(path)
|
25
23
|
end
|
26
|
-
|
27
|
-
|
28
|
-
paths.uniq!
|
29
|
-
paths.compact!
|
30
|
-
clear_test_files_list
|
31
|
-
paths
|
24
|
+
memo
|
25
|
+
end.uniq
|
32
26
|
end
|
33
27
|
|
34
28
|
private
|
35
29
|
|
36
|
-
def
|
37
|
-
|
38
|
-
|
39
|
-
Regexp.new("^/?(?:#{folders})(?:/|$)")
|
40
|
-
end
|
41
|
-
end
|
30
|
+
def _test_files_for_paths(paths = test_folders)
|
31
|
+
paths = _join_for_glob(Array(paths))
|
32
|
+
files = _join_for_glob(test_file_patterns)
|
42
33
|
|
43
|
-
|
44
|
-
path.match(test_folder_regex) && !path.match(/\..+$/) && File.directory?(path)
|
34
|
+
Dir["#{paths}/**/#{files}"]
|
45
35
|
end
|
46
36
|
|
47
|
-
def
|
48
|
-
|
37
|
+
def _all_test_files
|
38
|
+
@_all_test_files ||= _test_files_for_paths
|
49
39
|
end
|
50
40
|
|
51
|
-
def
|
52
|
-
|
41
|
+
def _test_file?(path)
|
42
|
+
_all_test_files.include?(path)
|
53
43
|
end
|
54
44
|
|
55
|
-
def
|
45
|
+
def _join_for_glob(fragments)
|
56
46
|
"{#{fragments.join(',')}}"
|
57
47
|
end
|
58
48
|
|
59
|
-
def test_files_for_paths(paths)
|
60
|
-
paths = join_for_glob(paths)
|
61
|
-
files = join_for_glob(test_file_patterns)
|
62
|
-
Dir.glob(paths + '/**/' + files)
|
63
|
-
end
|
64
|
-
|
65
|
-
def clear_test_files_list
|
66
|
-
@_test_files = nil
|
67
|
-
end
|
68
|
-
|
69
49
|
end
|
70
50
|
end
|
71
51
|
end
|
@@ -1,4 +1,6 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
+
require 'rubygems/requirement'
|
3
|
+
|
2
4
|
module Guard
|
3
5
|
class Minitest
|
4
6
|
class Runner
|
@@ -95,23 +97,29 @@ module Guard
|
|
95
97
|
|
96
98
|
def spring_command(paths)
|
97
99
|
cmd_parts = ['spring testunit']
|
98
|
-
cmd_parts << File.expand_path('../runners/old_runner.rb', __FILE__) unless
|
100
|
+
cmd_parts << File.expand_path('../runners/old_runner.rb', __FILE__) unless minitest_version_gte_5?
|
99
101
|
|
100
102
|
cmd_parts + relative_paths(paths)
|
101
103
|
end
|
102
104
|
|
103
105
|
def ruby_command(paths)
|
104
106
|
cmd_parts = ['ruby']
|
105
|
-
cmd_parts
|
107
|
+
cmd_parts.concat(test_folders.map {|f| %[-I"#{f}"] })
|
106
108
|
cmd_parts << '-r rubygems' if rubygems?
|
107
109
|
cmd_parts << '-r bundler/setup' if bundler?
|
108
|
-
cmd_parts
|
109
|
-
|
110
|
-
|
111
|
-
|
110
|
+
cmd_parts << '-r minitest/autorun'
|
111
|
+
cmd_parts.concat(paths.map { |path| "-r ./#{path}" })
|
112
|
+
|
113
|
+
unless minitest_version_gte_5?
|
112
114
|
cmd_parts << "-r #{File.expand_path('../runners/old_runner.rb', __FILE__)}"
|
113
|
-
cmd_parts << '-e \'MiniTest::Unit.autorun\''
|
114
115
|
end
|
116
|
+
|
117
|
+
# All the work is done through minitest/autorun
|
118
|
+
# and requiring the test files, so this is just
|
119
|
+
# a placeholder so Ruby doesn't try to exceute
|
120
|
+
# code from STDIN.
|
121
|
+
cmd_parts << '-e ""'
|
122
|
+
|
115
123
|
cmd_parts << '--'
|
116
124
|
cmd_parts += cli_options
|
117
125
|
end
|
@@ -136,6 +144,12 @@ module Guard
|
|
136
144
|
end
|
137
145
|
end
|
138
146
|
|
147
|
+
def minitest_version_gte_5?
|
148
|
+
requirement = Gem::Requirement.new('>= 5')
|
149
|
+
minitest_version = Gem::Version.new(::MiniTest::Unit::VERSION)
|
150
|
+
requirement.satisfied_by?(minitest_version)
|
151
|
+
end
|
152
|
+
|
139
153
|
end
|
140
154
|
end
|
141
155
|
end
|
@@ -1,5 +1,8 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
require 'rubygems/requirement'
|
2
|
+
|
3
|
+
requirement = Gem::Requirement.new('>= 5.0.4')
|
4
|
+
minitest_version = Gem::Version.new(::MiniTest::Unit::VERSION)
|
5
|
+
if requirement.satisfied_by?(minitest_version)
|
3
6
|
require 'guard/minitest/reporter'
|
4
7
|
else
|
5
8
|
require 'guard/minitest/reporters/old_reporter'
|
@@ -10,6 +13,6 @@ module Minitest
|
|
10
13
|
end
|
11
14
|
|
12
15
|
def self.plugin_guard_minitest_init(options) # :nodoc:
|
13
|
-
self.reporter << ::Guard::Minitest::Reporter.new
|
16
|
+
self.reporter << ::Guard::Minitest::Reporter.new
|
14
17
|
end
|
15
18
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: guard-minitest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.rc.
|
4
|
+
version: 1.0.0.rc.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yann Lugrin
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-06-
|
12
|
+
date: 2013-06-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: guard
|