guard-minitest 2.1.1 → 2.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/guard/minitest.rb +2 -15
- data/lib/guard/minitest/inspector.rb +0 -1
- data/lib/guard/minitest/notifier.rb +0 -1
- data/lib/guard/minitest/reporter.rb +0 -1
- data/lib/guard/minitest/reporters/old_reporter.rb +0 -1
- data/lib/guard/minitest/runner.rb +4 -13
- data/lib/guard/minitest/runners/old_runner.rb +0 -1
- data/lib/guard/minitest/utils.rb +28 -0
- data/lib/guard/minitest/version.rb +1 -1
- data/lib/minitest/guard_minitest_plugin.rb +2 -4
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e63896b46638892d2baf185be0cc4f7040120dbe
|
4
|
+
data.tar.gz: 59f0a5a3939759046ccf70500768e567002a10a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b08537a1c6899ac67750e7395bec5aeb8b02d7b441c563241690d9b42871a26a9d4c31a3044841794879caec4e529a8acbf6cc315be616eb3e321488584e618b
|
7
|
+
data.tar.gz: decb9b121ee3b71496b45c3b6378a4f29699dfaa6550ecfe15fcf1cec19cc6e5dd5219daf7ff4e79a65bd0bcc2046bac494b5f886c2ec595d094f97138281291
|
data/lib/guard/minitest.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
# encoding: utf-8
|
2
1
|
require 'guard'
|
3
2
|
require 'guard/plugin'
|
4
3
|
|
@@ -7,6 +6,7 @@ module Guard
|
|
7
6
|
|
8
7
|
require 'guard/minitest/inspector'
|
9
8
|
require 'guard/minitest/runner'
|
9
|
+
require 'guard/minitest/utils'
|
10
10
|
require 'guard/minitest/version'
|
11
11
|
|
12
12
|
def initialize(options = {})
|
@@ -20,7 +20,7 @@ module Guard
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def start
|
23
|
-
UI.info "Guard::Minitest #{MinitestVersion::VERSION} is running, with Minitest::Unit #{
|
23
|
+
UI.info "Guard::Minitest #{MinitestVersion::VERSION} is running, with Minitest::Unit #{Utils.minitest_version}!"
|
24
24
|
run_all if @options[:all_on_start]
|
25
25
|
end
|
26
26
|
|
@@ -51,18 +51,5 @@ module Guard
|
|
51
51
|
@inspector.clear_memoized_test_files
|
52
52
|
end
|
53
53
|
|
54
|
-
private
|
55
|
-
|
56
|
-
def _minitest_version
|
57
|
-
@_minitest_version ||= begin
|
58
|
-
require 'minitest'
|
59
|
-
::Minitest::VERSION
|
60
|
-
|
61
|
-
rescue LoadError, NameError
|
62
|
-
require 'minitest/unit'
|
63
|
-
::MiniTest::Unit::VERSION
|
64
|
-
end
|
65
|
-
end
|
66
|
-
|
67
54
|
end
|
68
55
|
end
|
@@ -1,12 +1,9 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
require 'rubygems/requirement'
|
3
|
-
|
4
1
|
module Guard
|
5
2
|
class Minitest
|
6
3
|
class Runner
|
7
4
|
|
8
5
|
def self.run(paths = [], options = {})
|
9
|
-
|
6
|
+
new(options).run(paths, options)
|
10
7
|
end
|
11
8
|
|
12
9
|
def initialize(options = {})
|
@@ -55,7 +52,7 @@ module Guard
|
|
55
52
|
end
|
56
53
|
|
57
54
|
def bundler?
|
58
|
-
@options[:bundler] &&
|
55
|
+
@options[:bundler] && !@options[:spring]
|
59
56
|
end
|
60
57
|
|
61
58
|
def rubygems?
|
@@ -117,7 +114,7 @@ module Guard
|
|
117
114
|
def spring_command(paths)
|
118
115
|
command = @options[:spring].is_a?(String) ? @options[:spring] : 'testunit'
|
119
116
|
cmd_parts = ['spring', command]
|
120
|
-
cmd_parts << File.expand_path('../runners/old_runner.rb', __FILE__) unless minitest_version_gte_5?
|
117
|
+
cmd_parts << File.expand_path('../runners/old_runner.rb', __FILE__) unless (Utils.minitest_version_gte_5? || command != 'testunit')
|
121
118
|
if cli_options.length > 0
|
122
119
|
cmd_parts + paths + ['--'] + cli_options
|
123
120
|
else
|
@@ -133,7 +130,7 @@ module Guard
|
|
133
130
|
cmd_parts << '-r minitest/autorun'
|
134
131
|
cmd_parts.concat(paths.map { |path| "-r ./#{path}" })
|
135
132
|
|
136
|
-
unless minitest_version_gte_5?
|
133
|
+
unless Utils.minitest_version_gte_5?
|
137
134
|
cmd_parts << "-r #{File.expand_path('../runners/old_runner.rb', __FILE__)}"
|
138
135
|
end
|
139
136
|
|
@@ -171,12 +168,6 @@ module Guard
|
|
171
168
|
end
|
172
169
|
end
|
173
170
|
|
174
|
-
def minitest_version_gte_5?
|
175
|
-
requirement = Gem::Requirement.new('>= 5')
|
176
|
-
minitest_version = Gem::Version.new(::MiniTest::Unit::VERSION)
|
177
|
-
requirement.satisfied_by?(minitest_version)
|
178
|
-
end
|
179
|
-
|
180
171
|
end
|
181
172
|
end
|
182
173
|
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'rubygems/requirement'
|
2
|
+
|
3
|
+
module Guard
|
4
|
+
class Minitest
|
5
|
+
class Utils
|
6
|
+
|
7
|
+
def self.minitest_version
|
8
|
+
@@minitest_version ||= begin
|
9
|
+
require 'minitest'
|
10
|
+
::Minitest::VERSION
|
11
|
+
|
12
|
+
rescue LoadError, NameError
|
13
|
+
require 'minitest/unit'
|
14
|
+
::MiniTest::Unit::VERSION
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.minitest_version_gte_5?
|
19
|
+
@@minitest_version_gte_5 ||= Gem::Requirement.new('>= 5').satisfied_by?(Gem::Version.new(minitest_version))
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.minitest_version_gte_5_0_4?
|
23
|
+
@@minitest_version_gte_5_0_4 ||= Gem::Requirement.new('>= 5.0.4').satisfied_by?(Gem::Version.new(minitest_version))
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -1,8 +1,6 @@
|
|
1
|
-
require '
|
1
|
+
require 'guard/minitest/utils'
|
2
2
|
|
3
|
-
|
4
|
-
minitest_version = Gem::Version.new(::MiniTest::Unit::VERSION)
|
5
|
-
if requirement.satisfied_by?(minitest_version)
|
3
|
+
if ::Guard::Minitest::Utils.minitest_version_gte_5_0_4?
|
6
4
|
require 'guard/minitest/reporter'
|
7
5
|
else
|
8
6
|
require 'guard/minitest/reporters/old_reporter'
|
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: 2.1.
|
4
|
+
version: 2.1.2
|
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-11-
|
12
|
+
date: 2013-11-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: guard
|
@@ -68,6 +68,7 @@ files:
|
|
68
68
|
- lib/guard/minitest/runner.rb
|
69
69
|
- lib/guard/minitest/runners/old_runner.rb
|
70
70
|
- lib/guard/minitest/templates/Guardfile
|
71
|
+
- lib/guard/minitest/utils.rb
|
71
72
|
- lib/guard/minitest/version.rb
|
72
73
|
- lib/guard/minitest.rb
|
73
74
|
- lib/minitest/guard_minitest_plugin.rb
|