guard-minitest 0.4.0.rc1 → 0.4.0.rc2

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -3,7 +3,7 @@
3
3
  Minitest guard allows to automatically & intelligently launch tests with
4
4
  {minitest framework}[http://github.com/seattlerb/minitest] when files are modified.
5
5
 
6
- - Compatible with MiniTest 1.7.x
6
+ - Compatible with MiniTest 1.7.x & 2.x
7
7
  - Tested on Ruby 1.8.6, 1.8.7 & 1.9.2.
8
8
 
9
9
  == Install
@@ -34,17 +34,17 @@ Please read {guard doc}[http://github.com/guard/guard#readme] for more info abou
34
34
  === Standard ruby gems with Minitest::Unit
35
35
 
36
36
  guard 'minitest' do
37
- watch('^test/test_(.*).rb')
38
- watch('^lib/(.*)([^/]+)\.rb') { |m| "test/#{m[1]}test_#{m[2]}.rb" }
39
- watch('^test/test_helper.rb') { "test" }
37
+ watch(%r|^test/test_(.*)\.rb|)
38
+ watch(%r|^lib/(.*)([^/]+)\.rb|) { |m| "test/#{m[1]}test_#{m[2]}.rb" }
39
+ watch(%r|^test/test_helper\.rb|) { "test" }
40
40
  end
41
41
 
42
42
  === Standard ruby gems with Minitest::Spec
43
43
 
44
44
  guard 'minitest' do
45
- watch('^spec/(.*)_spec.rb')
46
- watch('^lib/(.*)\.rb') { |m| "spec/#{m[1]}_spec.rb" }
47
- watch('^spec/spec_helper.rb') { "spec" }
45
+ watch(%r|^spec/(.*)_spec\.rb|)
46
+ watch(%r|^lib/(.*)\.rb|) { |m| "spec/#{m[1]}_spec.rb" }
47
+ watch(%r|^spec/spec_helper\.rb|) { "spec" }
48
48
  end
49
49
 
50
50
  == Options
@@ -89,4 +89,4 @@ you make.
89
89
 
90
90
  == Authors
91
91
 
92
- {Yann Lugrin}[http://github.com/yannlugrin]
92
+ {Yann Lugrin}[http://github.com/yannlugrin]
@@ -15,7 +15,6 @@ module Guard
15
15
  end
16
16
 
17
17
  def start
18
- UI.info "Guard running MiniTest #{@runner.version}"
19
18
  true
20
19
  end
21
20
 
@@ -12,18 +12,11 @@ module Guard
12
12
  end
13
13
 
14
14
  def initialize(options = {})
15
- minitest_version = begin
16
- MiniTest::Unit.const_defined?(:VERSION) && MiniTest::Unit::VERSION =~ /^1/ ? 1 : 2
17
- rescue
18
- 2
19
- end
20
-
21
15
  @options = {
22
16
  :verbose => false,
23
17
  :notify => true,
24
18
  :bundler => File.exist?("#{Dir.pwd}/Gemfile"),
25
- :rubygems => false,
26
- :version => minitest_version
19
+ :rubygems => false
27
20
  }.merge(options)
28
21
  end
29
22
 
@@ -53,10 +46,6 @@ module Guard
53
46
  !bundler? && @options[:rubygems]
54
47
  end
55
48
 
56
- def version
57
- @options[:version].to_i
58
- end
59
-
60
49
  private
61
50
 
62
51
  def minitest_command(paths)
@@ -68,11 +57,7 @@ module Guard
68
57
  paths.each do |path|
69
58
  cmd_parts << "-r #{path}"
70
59
  end
71
- if version == 1
72
- cmd_parts << "-r #{File.expand_path('../runners/version_1_runner.rb', __FILE__)}"
73
- else
74
- cmd_parts << "-r #{File.expand_path('../runners/version_2_runner.rb', __FILE__)}"
75
- end
60
+ cmd_parts << "-r #{File.expand_path('../runners/default_runner.rb', __FILE__)}"
76
61
  if notify?
77
62
  cmd_parts << '-e \'GUARD_NOTIFY=true; MiniTest::Unit.autorun\''
78
63
  else
@@ -0,0 +1,8 @@
1
+ # encoding: utf-8
2
+ require 'minitest/unit'
3
+
4
+ if MiniTest::Unit::VERSION =~ /^1/
5
+ load File.expand_path('../version_1_runner.rb', __FILE__)
6
+ else
7
+ load File.expand_path('../version_2_runner.rb', __FILE__)
8
+ end
@@ -1,11 +1,11 @@
1
1
  guard 'minitest' do
2
2
  # with Minitest::Unit
3
- watch(%r|^test/test_(.*).rb|)
4
- watch(%r|^lib/(.*)([^/]+)\.rb|) { |m| "test/#{m[1]}test_#{m[2]}.rb" }
5
- watch(%r|^test/test_helper.rb|) { "test" }
3
+ watch(%r|^test/test_(.*)\.rb|)
4
+ watch(%r|^lib/(.*)([^/]+)\.rb|) { |m| "test/#{m[1]}test_#{m[2]}.rb" }
5
+ watch(%r|^test/test_helper\.rb|) { "test" }
6
6
 
7
7
  # with Minitest::Spec
8
- # watch(%r|^spec/(.*)_spec.rb|)
9
- # watch(%r|^lib/(.*)\.rb|) { |m| "spec/#{m[1]}_spec.rb" }
10
- # watch(%r|^spec/spec_helper.rb|) { "spec" }
8
+ # watch(%r|^spec/(.*)_spec\.rb|)
9
+ # watch(%r|^lib/(.*)\.rb|) { |m| "spec/#{m[1]}_spec.rb" }
10
+ # watch(%r|^spec/spec_helper\.rb|) { "spec" }
11
11
  end
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
  module Guard
3
3
  module MinitestVersion
4
- VERSION = '0.4.0.rc1'
4
+ VERSION = '0.4.0.rc2'
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard-minitest
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15424087
4
+ hash: 15424081
5
5
  prerelease: 6
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
9
  - 0
10
10
  - rc
11
- - 1
12
- version: 0.4.0.rc1
11
+ - 2
12
+ version: 0.4.0.rc2
13
13
  platform: ruby
14
14
  authors:
15
15
  - Yann Lugrin
@@ -96,6 +96,7 @@ extra_rdoc_files: []
96
96
  files:
97
97
  - lib/guard/minitest/runners/version_1_runner.rb
98
98
  - lib/guard/minitest/runners/version_2_runner.rb
99
+ - lib/guard/minitest/runners/default_runner.rb
99
100
  - lib/guard/minitest/inspector.rb
100
101
  - lib/guard/minitest/templates/Guardfile
101
102
  - lib/guard/minitest/notifier.rb