guard-sporkminitest 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gemspec +34 -0
- data/.gitignore +13 -0
- data/.travis.yml +22 -0
- data/Gemfile +2 -0
- data/Guardfile +6 -0
- data/LICENSE +20 -0
- data/README.md +123 -0
- data/Rakefile +71 -0
- data/gemfiles/minitest-1.7 +8 -0
- data/gemfiles/minitest-2 +8 -0
- data/lib/guard/sporkminitest/inspector.rb +70 -0
- data/lib/guard/sporkminitest/notifier.rb +37 -0
- data/lib/guard/sporkminitest/runner.rb +108 -0
- data/lib/guard/sporkminitest/runners/default_runner.rb +8 -0
- data/lib/guard/sporkminitest/runners/version_1_runner.rb +17 -0
- data/lib/guard/sporkminitest/runners/version_2_runner.rb +22 -0
- data/lib/guard/sporkminitest/templates/Guardfile +30 -0
- data/lib/guard/sporkminitest/version.rb +6 -0
- data/lib/guard/sporkminitest.rb +42 -0
- data/spec/fixtures/bundler/Gemfile +0 -0
- data/spec/guard/minitest/inspector_spec.rb +50 -0
- data/spec/guard/minitest/notifier_spec.rb +40 -0
- data/spec/guard/minitest/runner_spec.rb +175 -0
- data/spec/guard/minitest_spec.rb +78 -0
- data/spec/spec_helper.rb +40 -0
- data/test/guard/minitest/test_inspector.rb +0 -0
- data/test/guard/minitest_test.rb +0 -0
- data/test/guard/test_minitest.rb +0 -0
- metadata +231 -0
data/.gemspec
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
$:.unshift './lib'
|
3
|
+
require 'guard/sporkminitest/version'
|
4
|
+
|
5
|
+
Gem::Specification.new do |gem|
|
6
|
+
gem.name = 'guard-sporkminitest'
|
7
|
+
gem.version = Guard::SporkMinitest::VERSION
|
8
|
+
gem.authors = ['Yann Lugrin', '☈king']
|
9
|
+
gem.email = ['rking-guard-sporkminitest@sharpsaw.org']
|
10
|
+
gem.homepage = 'https://github.com/rking/guard-minitest'
|
11
|
+
gem.description = gem.summary = 'Guard test files for Spork-owned MiniTest'
|
12
|
+
gem.files = `git ls-files`.split($/)
|
13
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{|f| File.basename f}
|
14
|
+
gem.test_files = gem.files.grep %r{^ test|spec|features/}
|
15
|
+
gem.require_path = 'lib'
|
16
|
+
|
17
|
+
# TODO doc these a bit
|
18
|
+
%w(
|
19
|
+
guard
|
20
|
+
guard-spork
|
21
|
+
spork-minitest
|
22
|
+
rb-inotify
|
23
|
+
rb-fsevent
|
24
|
+
).each{|dep| gem.add_dependency dep }
|
25
|
+
|
26
|
+
%w(
|
27
|
+
rake
|
28
|
+
minitest
|
29
|
+
bundler
|
30
|
+
mocha
|
31
|
+
).each{|dep| gem.add_development_dependency dep}
|
32
|
+
|
33
|
+
gem.rdoc_options = ["--charset=UTF-8", "--main=README.rdoc", "--exclude='(lib|test|spec)|(Gem|Guard|Rake)file'"]
|
34
|
+
end
|
data/.gitignore
ADDED
data/.travis.yml
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
branches:
|
2
|
+
only:
|
3
|
+
- master
|
4
|
+
rvm:
|
5
|
+
- 1.8.7
|
6
|
+
- 1.9.2
|
7
|
+
- 1.9.3
|
8
|
+
# - ree
|
9
|
+
# - jruby-18mode
|
10
|
+
# - jruby-19mode
|
11
|
+
# - rbx-18mode
|
12
|
+
# - rbx-19mode
|
13
|
+
gemfile:
|
14
|
+
- gemfiles/minitest-1.7
|
15
|
+
- gemfiles/minitest-2
|
16
|
+
matrix:
|
17
|
+
exclude:
|
18
|
+
- rvm: 1.8.7
|
19
|
+
gemfile: gemfiles/minitest-2
|
20
|
+
notifications:
|
21
|
+
recipients:
|
22
|
+
- yann.lugrin@sans-savoir.net
|
data/Gemfile
ADDED
data/Guardfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2010 Yann Lugrin
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,123 @@
|
|
1
|
+
# TOTALLY TODO
|
2
|
+
|
3
|
+
Sorry. BBIAB.
|
4
|
+
|
5
|
+
|
6
|
+
|
7
|
+
|
8
|
+
|
9
|
+
Guard::Minitest [![Build Status](https://secure.travis-ci.org/guard/guard-minitest.png?branch=master)](http://travis-ci.org/guard/guard-minitest)
|
10
|
+
===============
|
11
|
+
|
12
|
+
Minitest guard allows to automatically & intelligently launch tests with
|
13
|
+
[minitest framework](http://github.com/seattlerb/minitest) when files are modified.
|
14
|
+
|
15
|
+
* Compatible with MiniTest 1.7.x & 2.x
|
16
|
+
* Tested on Ruby 1.8.7, 1.9.2 & 1.9.3
|
17
|
+
|
18
|
+
Install
|
19
|
+
-------
|
20
|
+
|
21
|
+
Please be sure to have [Guard](http://github.com/guard/guard) installed before continue.
|
22
|
+
|
23
|
+
Install the gem:
|
24
|
+
|
25
|
+
```bash
|
26
|
+
gem install guard-minitest
|
27
|
+
```
|
28
|
+
|
29
|
+
Add it to your Gemfile (inside test group):
|
30
|
+
|
31
|
+
```ruby
|
32
|
+
gem 'guard-minitest'
|
33
|
+
```
|
34
|
+
|
35
|
+
Add guard definition to your Guardfile by running this command:
|
36
|
+
|
37
|
+
```bash
|
38
|
+
guard init minitest
|
39
|
+
```
|
40
|
+
|
41
|
+
Usage
|
42
|
+
-----
|
43
|
+
|
44
|
+
Please read [Guard usage doc](http://github.com/guard/guard#readme)
|
45
|
+
|
46
|
+
Guardfile
|
47
|
+
---------
|
48
|
+
|
49
|
+
Minitest guard can be really adapated to all kind of projects.
|
50
|
+
Please read [guard doc](http://github.com/guard/guard#readme) for more info about Guardfile DSL.
|
51
|
+
|
52
|
+
### Standard ruby gems with Minitest::Unit
|
53
|
+
|
54
|
+
```ruby
|
55
|
+
guard 'minitest' do
|
56
|
+
watch(%r|^test/test_(.*)\.rb|)
|
57
|
+
watch(%r{^lib/(.*/)?([^/]+)\.rb$}) { |m| "test/#{m[1]}test_#{m[2]}.rb" }
|
58
|
+
watch(%r|^test/test_helper\.rb|) { "test" }
|
59
|
+
end
|
60
|
+
```
|
61
|
+
|
62
|
+
### Standard ruby gems with Minitest::Spec
|
63
|
+
|
64
|
+
```ruby
|
65
|
+
guard 'minitest' do
|
66
|
+
watch(%r|^spec/(.*)_spec\.rb|)
|
67
|
+
watch(%r{^lib/(.*/)?([^/]+)\.rb$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
|
68
|
+
watch(%r|^spec/spec_helper\.rb|) { "spec" }
|
69
|
+
end
|
70
|
+
```
|
71
|
+
|
72
|
+
Options
|
73
|
+
-------
|
74
|
+
|
75
|
+
You can change the default location and pattern of minitest files:
|
76
|
+
|
77
|
+
```ruby
|
78
|
+
guard 'minitest', test_folders: 'test/unit', test_file_patterns: '*_test.rb' do
|
79
|
+
# ...
|
80
|
+
end
|
81
|
+
```
|
82
|
+
|
83
|
+
You can pass any of the standard MiniTest CLI options using the :cli option:
|
84
|
+
|
85
|
+
```ruby
|
86
|
+
guard 'minitest', :cli => "--seed 123456 --verbose" do
|
87
|
+
# ...
|
88
|
+
end
|
89
|
+
```
|
90
|
+
|
91
|
+
If you use [spork-testunit](https://github.com/sporkrb/spork-testunit) you can enable it with (you'll have to load it before):
|
92
|
+
|
93
|
+
```ruby
|
94
|
+
guard 'minitest', :drb => true do
|
95
|
+
# ...
|
96
|
+
end
|
97
|
+
```
|
98
|
+
|
99
|
+
### List of available options:
|
100
|
+
|
101
|
+
```ruby
|
102
|
+
:cli => '--test' # pass arbitrary Minitest CLI arguments, default: ''
|
103
|
+
:bundler => false # don't use "bundle exec" to run the minitest command, default: true
|
104
|
+
:rubygems => true # require rubygems when run the minitest command (only if bundler is disabled), default: false
|
105
|
+
:drb => true # enable DRb support, default: false
|
106
|
+
:test_folders => ['tests'] # specify an array of paths that contain test files, default: %w[test spec]
|
107
|
+
:test_file_patterns => true # specify an array of patterns that test files must match in order to be run, default: %w[*_test.rb test_*.rb *_spec.rb]
|
108
|
+
```
|
109
|
+
|
110
|
+
Development
|
111
|
+
-----------
|
112
|
+
|
113
|
+
* Source hosted on [GitHub](http://github.com/guard/guard-minitest)
|
114
|
+
* Report issues/Questions/Feature requests on [GitHub Issues](http://github.com/guard/guard-minitest/issues)
|
115
|
+
|
116
|
+
Pull requests are very welcome! Make sure your patches are well tested. Please create a topic branch for every separate change
|
117
|
+
you make.
|
118
|
+
|
119
|
+
Authors
|
120
|
+
-------
|
121
|
+
|
122
|
+
[Yann Lugrin](http://github.com/yannlugrin)
|
123
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
require 'bundler'
|
2
|
+
Bundler::GemHelper.install_tasks
|
3
|
+
|
4
|
+
require 'minitest/unit'
|
5
|
+
|
6
|
+
desc 'Run all tests'
|
7
|
+
task :test do
|
8
|
+
ENV['QUIET'] ||= 'true'
|
9
|
+
|
10
|
+
$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + '/spec'))
|
11
|
+
$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__)))
|
12
|
+
|
13
|
+
MiniTest::Unit.autorun
|
14
|
+
|
15
|
+
test_files = Dir['spec/**/*_spec.rb']
|
16
|
+
test_files.each { |f| require f }
|
17
|
+
end
|
18
|
+
|
19
|
+
task :default => :test
|
20
|
+
|
21
|
+
require 'rbconfig'
|
22
|
+
namespace(:test) do
|
23
|
+
if RbConfig::CONFIG['host_os'] =~ /mswin|mingw/i
|
24
|
+
desc "Run all specs on multiple ruby versions (requires pik)"
|
25
|
+
task(:portability) do
|
26
|
+
puts 'minitest can\'t be tested on MS Windows for now'
|
27
|
+
end
|
28
|
+
else
|
29
|
+
desc "Run all specs on multiple ruby versions (requires rvm)"
|
30
|
+
task(:portability) do
|
31
|
+
travis_config_file = File.expand_path("../.travis.yml", __FILE__)
|
32
|
+
begin
|
33
|
+
travis_options ||= YAML::load_file(travis_config_file)
|
34
|
+
rescue => ex
|
35
|
+
puts "Travis config file '#{travis_config_file}' could not be found: #{ex.message}"
|
36
|
+
return
|
37
|
+
end
|
38
|
+
|
39
|
+
travis_options['rvm'].each do |version|
|
40
|
+
system <<-BASH
|
41
|
+
bash -c 'source ~/.rvm/scripts/rvm;
|
42
|
+
rvm #{version};
|
43
|
+
ruby_version_string_size=`ruby -v | wc -m`
|
44
|
+
echo;
|
45
|
+
for ((c=1; c<$ruby_version_string_size+21; c++)); do echo -n "="; done
|
46
|
+
echo;
|
47
|
+
echo "minitest version 1 - `ruby -v`";
|
48
|
+
for ((c=1; c<$ruby_version_string_size+21; c++)); do echo -n "="; done
|
49
|
+
echo;
|
50
|
+
BUNDLE_GEMFILE=./gemfiles/minitest-1.7 bundle install;
|
51
|
+
BUNDLE_GEMFILE=./gemfiles/minitest-1.7 bundle exec rake test 2>&1'
|
52
|
+
BASH
|
53
|
+
if version =~ /^1\.9/
|
54
|
+
system <<-BASH
|
55
|
+
bash -c 'source ~/.rvm/scripts/rvm;
|
56
|
+
rvm #{version};
|
57
|
+
ruby_version_string_size=`ruby -v | wc -m`
|
58
|
+
echo;
|
59
|
+
for ((c=1; c<$ruby_version_string_size+21; c++)); do echo -n "="; done
|
60
|
+
echo;
|
61
|
+
echo "minitest version 2 - `ruby -v`";
|
62
|
+
for ((c=1; c<$ruby_version_string_size+21; c++)); do echo -n "="; done
|
63
|
+
echo;
|
64
|
+
BUNDLE_GEMFILE=./gemfiles/minitest-2.1 bundle install;
|
65
|
+
BUNDLE_GEMFILE=./gemfiles/minitest-2.1 bundle exec rake test 2>&1'
|
66
|
+
BASH
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
data/gemfiles/minitest-2
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
module Guard
|
3
|
+
class SporkMinitest
|
4
|
+
class Inspector
|
5
|
+
|
6
|
+
attr_reader :test_folders, :test_file_patterns
|
7
|
+
|
8
|
+
def initialize(test_folders, test_file_patterns)
|
9
|
+
@test_folders = test_folders.uniq.compact.freeze
|
10
|
+
@test_file_patterns = test_file_patterns.uniq.compact.freeze
|
11
|
+
end
|
12
|
+
|
13
|
+
def clean_all
|
14
|
+
clean self.test_folders
|
15
|
+
end
|
16
|
+
|
17
|
+
def clean(paths)
|
18
|
+
paths = paths.uniq.compact unless paths == @test_folders
|
19
|
+
paths = paths.select { |p| test_file?(p) || test_folder?(p) }
|
20
|
+
|
21
|
+
paths.dup.each do |path|
|
22
|
+
if File.directory?(path)
|
23
|
+
paths.delete(path)
|
24
|
+
paths += test_files_for_paths([path])
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
paths.uniq!
|
29
|
+
paths.compact!
|
30
|
+
clear_test_files_list
|
31
|
+
paths
|
32
|
+
end
|
33
|
+
|
34
|
+
private
|
35
|
+
def test_folder_regex
|
36
|
+
@test_folder_regex ||= (
|
37
|
+
folders= self.test_folders.map {|f| Regexp.quote f}.join '|'
|
38
|
+
Regexp.new("^/?(?:#{folders})(?:/|$)")
|
39
|
+
)
|
40
|
+
end
|
41
|
+
|
42
|
+
def test_folder?(path)
|
43
|
+
path.match(test_folder_regex) && !path.match(/\..+$/) && File.directory?(path)
|
44
|
+
end
|
45
|
+
|
46
|
+
def test_file?(path)
|
47
|
+
test_files.include?(path)
|
48
|
+
end
|
49
|
+
|
50
|
+
def test_files
|
51
|
+
@test_files ||= test_files_for_paths(self.test_folders)
|
52
|
+
end
|
53
|
+
|
54
|
+
def join_for_glob(fragments)
|
55
|
+
"{#{fragments.join ','}}"
|
56
|
+
end
|
57
|
+
|
58
|
+
def test_files_for_paths(paths)
|
59
|
+
paths = join_for_glob(paths)
|
60
|
+
files = join_for_glob(self.test_file_patterns)
|
61
|
+
Dir.glob(paths + '/**/' + files)
|
62
|
+
end
|
63
|
+
|
64
|
+
def clear_test_files_list
|
65
|
+
@test_files = nil
|
66
|
+
end
|
67
|
+
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'guard/notifier'
|
3
|
+
|
4
|
+
module Guard
|
5
|
+
class SporkMinitestNotifier
|
6
|
+
|
7
|
+
def self.guard_message(test_count, assertion_count, failure_count, error_count, skip_count, duration)
|
8
|
+
message = "#{test_count} examples, #{assertion_count} assertions, #{failure_count} failures, #{error_count} errors"
|
9
|
+
if skip_count > 0
|
10
|
+
message << " (#{skip_count} skips)"
|
11
|
+
end
|
12
|
+
if test_count && assertion_count
|
13
|
+
message << "\nin %.6f seconds, %.4f tests/s, %.4f assertions/s." % [duration, test_count / duration, assertion_count / duration]
|
14
|
+
end
|
15
|
+
message
|
16
|
+
end
|
17
|
+
|
18
|
+
# failed | pending (skip) | success
|
19
|
+
def self.guard_image(failure_count, skip_count)
|
20
|
+
icon = if failure_count > 0
|
21
|
+
:failed
|
22
|
+
elsif skip_count > 0
|
23
|
+
:pending
|
24
|
+
else
|
25
|
+
:success
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def self.notify(test_count, assertion_count, failure_count, error_count, skip_count, duration)
|
30
|
+
message = guard_message(test_count, assertion_count, failure_count, error_count, skip_count, duration)
|
31
|
+
image = guard_image(failure_count + error_count, skip_count)
|
32
|
+
|
33
|
+
::Guard::Notifier.notify(message, :title => 'MiniTest results', :image => image)
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,108 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
module Guard
|
3
|
+
class SporkMinitest
|
4
|
+
class Runner
|
5
|
+
|
6
|
+
class << self
|
7
|
+
|
8
|
+
def run(paths = [], options = {})
|
9
|
+
Runner.new(options).run(paths, options)
|
10
|
+
end
|
11
|
+
|
12
|
+
end
|
13
|
+
|
14
|
+
def initialize(options = {})
|
15
|
+
parse_deprecated_options(options)
|
16
|
+
|
17
|
+
@options = {
|
18
|
+
:bundler => File.exist?("#{Dir.pwd}/Gemfile"),
|
19
|
+
:rubygems => false,
|
20
|
+
:drb => false,
|
21
|
+
:test_folders => %w[test spec],
|
22
|
+
:test_file_patterns => %w[*_test.rb test_*.rb *_spec.rb],
|
23
|
+
:cli => ''
|
24
|
+
}.merge(options)
|
25
|
+
|
26
|
+
[:test_folders, :test_file_patterns].each do |k|
|
27
|
+
@options[k] = Array(@options[k]).uniq.compact
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def run(paths, options = {})
|
32
|
+
message = options[:message] || "Running: #{paths.join(' ')}"
|
33
|
+
UI.info message, :reset => true
|
34
|
+
system(minitest_command(paths))
|
35
|
+
end
|
36
|
+
|
37
|
+
def cli_options
|
38
|
+
@options[:cli] ||= ''
|
39
|
+
end
|
40
|
+
|
41
|
+
def bundler?
|
42
|
+
@options[:bundler]
|
43
|
+
end
|
44
|
+
|
45
|
+
def rubygems?
|
46
|
+
!bundler? && @options[:rubygems]
|
47
|
+
end
|
48
|
+
|
49
|
+
def drb?
|
50
|
+
@options[:drb]
|
51
|
+
end
|
52
|
+
|
53
|
+
def test_folders
|
54
|
+
@options[:test_folders]
|
55
|
+
end
|
56
|
+
|
57
|
+
def test_file_patterns
|
58
|
+
@options[:test_file_patterns]
|
59
|
+
end
|
60
|
+
|
61
|
+
private
|
62
|
+
|
63
|
+
def minitest_command(paths)
|
64
|
+
cmd_parts = []
|
65
|
+
|
66
|
+
# Does nothing but slow things down. Please correct me if I'm wrong:
|
67
|
+
# cmd_parts << "bundle exec" if bundler?
|
68
|
+
if drb?
|
69
|
+
cmd_parts << 'testdrb'
|
70
|
+
cmd_parts += paths.map{ |path| "./#{path}" }
|
71
|
+
else
|
72
|
+
# TODO: nuke this branch
|
73
|
+
cmd_parts << 'ruby'
|
74
|
+
cmd_parts += test_folders.map{|f| %[-I"#{f}"] }
|
75
|
+
cmd_parts << '-r rubygems' if rubygems?
|
76
|
+
cmd_parts << '-r bundler/setup' if bundler?
|
77
|
+
cmd_parts += paths.map{ |path| "-r ./#{path}" }
|
78
|
+
cmd_parts << "-r #{File.expand_path('../runners/default_runner.rb', __FILE__)}"
|
79
|
+
cmd_parts << '-e \'MiniTest::Unit.autorun\''
|
80
|
+
cmd_parts << '--' << cli_options unless cli_options.empty?
|
81
|
+
end
|
82
|
+
|
83
|
+
cmd_parts.join(' ')
|
84
|
+
end
|
85
|
+
|
86
|
+
def parse_deprecated_options(options)
|
87
|
+
options[:cli] ||= ''
|
88
|
+
|
89
|
+
# TODO remove this
|
90
|
+
if options.key?(:notify)
|
91
|
+
UI.info %{DEPRECATION WARNING: The :notify option is deprecated. Guard notification configuration is used.}
|
92
|
+
end
|
93
|
+
|
94
|
+
[:seed, :verbose].each do |key|
|
95
|
+
if value = options.delete(key)
|
96
|
+
options[:cli] << " --#{key}"
|
97
|
+
if ![TrueClass, FalseClass].include?(value.class)
|
98
|
+
options[:cli] << " #{value}"
|
99
|
+
end
|
100
|
+
|
101
|
+
UI.info %{DEPRECATION WARNING: The :#{key} option is deprecated. Pass standard command line argument "--#{key}" to MiniTest with the :cli option.}
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'minitest/unit'
|
3
|
+
require 'guard/minitest/notifier'
|
4
|
+
|
5
|
+
module MiniTest
|
6
|
+
class MiniTest::Unit
|
7
|
+
|
8
|
+
alias_method :run_without_guard, :run
|
9
|
+
def run(args = [])
|
10
|
+
start = Time.now
|
11
|
+
run_without_guard(args)
|
12
|
+
duration = Time.now - start
|
13
|
+
::Guard::MinitestNotifier.notify(test_count, assertion_count, failures, errors, skips, duration)
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'minitest/unit'
|
3
|
+
require 'guard/minitest/notifier'
|
4
|
+
|
5
|
+
module MiniTest
|
6
|
+
class MiniTest::Unit
|
7
|
+
|
8
|
+
begin
|
9
|
+
alias_method :_run_anything_without_guard, :_run_anything
|
10
|
+
def _run_anything(type)
|
11
|
+
start = Time.now
|
12
|
+
_run_anything_without_guard(type)
|
13
|
+
duration = Time.now - start
|
14
|
+
::Guard::SporkMinitestNotifier.notify(test_count, assertion_count, failures, errors, skips, duration)
|
15
|
+
end
|
16
|
+
rescue NameError
|
17
|
+
puts "*** WARN: if you use MiniTest 1, please add version option in your 'Guardfile`."
|
18
|
+
raise
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
guard 'minitest' do
|
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" }
|
6
|
+
|
7
|
+
# with Minitest::Spec
|
8
|
+
# watch(%r|^spec/(.*)_spec\.rb|)
|
9
|
+
# watch(%r|^lib/(.*)([^/]+)\.rb|) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
|
10
|
+
# watch(%r|^spec/spec_helper\.rb|) { "spec" }
|
11
|
+
|
12
|
+
# Rails 4
|
13
|
+
# watch(%r|^test/test_helper\.rb|) { "test" }
|
14
|
+
# watch(%r|^test/.+_test\.rb|)
|
15
|
+
# watch(%r|^app/(.+)\.rb|) { |m| "test/#{m[1]}_test.rb" }
|
16
|
+
# watch(%r|^app/controllers/application_controller\.rb|) { "test/controllers" }
|
17
|
+
# watch(%r|^app/controllers/(.+)_controller\.rb|) { |m| "test/integration/#{m[1]}_test.rb" }
|
18
|
+
# watch(%r|^app/views/(.+)_mailer/.+|) { |m| "test/mailers/#{m[1]}_mailer_test.rb" }
|
19
|
+
# watch(%r|^lib/(.+)\.rb|) { |m| "test/lib/#{m[1]}_test.rb" }
|
20
|
+
|
21
|
+
# Rails 3.2
|
22
|
+
# watch(%r|^app/controllers/(.*)\.rb|) { |m| "test/controllers/#{m[1]}_test.rb" }
|
23
|
+
# watch(%r|^app/helpers/(.*)\.rb|) { |m| "test/helpers/#{m[1]}_test.rb" }
|
24
|
+
# watch(%r|^app/models/(.*)\.rb|) { |m| "test/unit/#{m[1]}_test.rb" }
|
25
|
+
|
26
|
+
# Rails
|
27
|
+
# watch(%r|^app/controllers/(.*)\.rb|) { |m| "test/functional/#{m[1]}_test.rb" }
|
28
|
+
# watch(%r|^app/helpers/(.*)\.rb|) { |m| "test/helpers/#{m[1]}_test.rb" }
|
29
|
+
# watch(%r|^app/models/(.*)\.rb|) { |m| "test/unit/#{m[1]}_test.rb" }
|
30
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'guard'
|
3
|
+
require 'guard/guard'
|
4
|
+
|
5
|
+
module Guard
|
6
|
+
class SporkMinitest < Guard
|
7
|
+
|
8
|
+
autoload :Runner, 'guard/sporkminitest/runner'
|
9
|
+
autoload :Inspector, 'guard/sporkminitest/inspector'
|
10
|
+
|
11
|
+
def initialize(watchers = [], options = {})
|
12
|
+
super
|
13
|
+
|
14
|
+
@runner = Runner.new(options)
|
15
|
+
@inspector = Inspector.new(@runner.test_folders, @runner.test_file_patterns)
|
16
|
+
end
|
17
|
+
|
18
|
+
def start
|
19
|
+
true
|
20
|
+
end
|
21
|
+
|
22
|
+
def stop
|
23
|
+
true
|
24
|
+
end
|
25
|
+
|
26
|
+
def reload
|
27
|
+
true
|
28
|
+
end
|
29
|
+
|
30
|
+
def run_all
|
31
|
+
paths = @inspector.clean_all
|
32
|
+
return @runner.run(paths, :message => 'Running all tests') unless paths.empty?
|
33
|
+
true
|
34
|
+
end
|
35
|
+
|
36
|
+
def run_on_changes(paths = [])
|
37
|
+
paths = @inspector.clean(paths)
|
38
|
+
return @runner.run(paths) unless paths.empty?
|
39
|
+
true
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
File without changes
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'spec_helper'
|
3
|
+
|
4
|
+
describe Guard::Minitest::Inspector do
|
5
|
+
subject { Guard::Minitest::Inspector.new(%w[test spec], %w[*_test.rb test_*.rb *_spec.rb]) }
|
6
|
+
|
7
|
+
describe 'clean' do
|
8
|
+
|
9
|
+
before(:each) do
|
10
|
+
@files_on_disk = ['test/guard/minitest/test_inspector.rb', 'test/guard/test_minitest.rb', 'test/guard/minitest_test.rb'].sort
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should add all test files under the given dir" do
|
14
|
+
subject.clean(['test']).sort.must_equal @files_on_disk
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'should remove non-test files' do
|
18
|
+
subject.clean(['test/guard/test_minitest.rb', 'bob.rb']).wont_include 'bob.rb'
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'should remove non-existing test files' do
|
22
|
+
subject.clean(['test/guard/test_minitest.rb', 'test_bob.rb']).wont_include 'test_bob.rb'
|
23
|
+
end
|
24
|
+
|
25
|
+
it 'should remove non-test existing files (2)' do
|
26
|
+
subject.clean(['test/guard/minitest/test_formatter.rb']).must_equal []
|
27
|
+
end
|
28
|
+
|
29
|
+
it 'should keep test folder path' do
|
30
|
+
subject.clean(['test/guard/test_minitest.rb', 'test']).sort.must_equal @files_on_disk
|
31
|
+
end
|
32
|
+
|
33
|
+
it 'should remove duplication' do
|
34
|
+
subject.clean(['test/guard/test_minitest.rb', 'test/guard/test_minitest.rb']).must_equal ['test/guard/test_minitest.rb']
|
35
|
+
end
|
36
|
+
|
37
|
+
it 'should remove duplication (2)' do
|
38
|
+
subject.clean(['test', 'test']).sort.must_equal @files_on_disk
|
39
|
+
end
|
40
|
+
|
41
|
+
it 'should remove test folder includes in other test folder' do
|
42
|
+
subject.clean(['test/minitest', 'test']).sort.must_equal @files_on_disk
|
43
|
+
end
|
44
|
+
|
45
|
+
it 'should not include test files not in the given dir' do
|
46
|
+
subject.clean(['test/guard/minitest']).wont_include 'test/guard/minitest_test.rb'
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'spec_helper'
|
3
|
+
require 'guard/minitest/notifier'
|
4
|
+
|
5
|
+
describe Guard::MinitestNotifier do
|
6
|
+
subject { Guard::MinitestNotifier }
|
7
|
+
|
8
|
+
it 'should format message without skipped test' do
|
9
|
+
message = subject.guard_message(1, 2, 3, 4, 0, 10.0)
|
10
|
+
message.must_equal "1 examples, 2 assertions, 3 failures, 4 errors\nin 10.000000 seconds, 0.1000 tests/s, 0.2000 assertions/s."
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'should format message with skipped test' do
|
14
|
+
message = subject.guard_message(1, 2, 3, 4, 5, 10.0)
|
15
|
+
message.must_equal "1 examples, 2 assertions, 3 failures, 4 errors (5 skips)\nin 10.000000 seconds, 0.1000 tests/s, 0.2000 assertions/s."
|
16
|
+
end
|
17
|
+
|
18
|
+
it 'should select failed image' do
|
19
|
+
subject.guard_image(1, 2).must_equal :failed
|
20
|
+
subject.guard_image(1, 0).must_equal :failed
|
21
|
+
end
|
22
|
+
|
23
|
+
it 'should select pending image' do
|
24
|
+
subject.guard_image(0, 2).must_equal :pending
|
25
|
+
end
|
26
|
+
|
27
|
+
it 'should select success image' do
|
28
|
+
subject.guard_image(0, 0).must_equal :success
|
29
|
+
end
|
30
|
+
|
31
|
+
it 'should call Guard::Notifier' do
|
32
|
+
::Guard::Notifier.expects(:notify).with(
|
33
|
+
"1 examples, 2 assertions, 0 failures, 0 errors\nin 10.000000 seconds, 0.1000 tests/s, 0.2000 assertions/s.",
|
34
|
+
:title => 'MiniTest results',
|
35
|
+
:image => :success
|
36
|
+
)
|
37
|
+
subject.notify(1, 2, 0, 0, 0, 10.0)
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
@@ -0,0 +1,175 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'spec_helper'
|
3
|
+
|
4
|
+
describe Guard::Minitest::Runner do
|
5
|
+
subject { Guard::Minitest::Runner }
|
6
|
+
|
7
|
+
describe 'options' do
|
8
|
+
|
9
|
+
describe 'cli_options' do
|
10
|
+
it 'default should be empty string' do
|
11
|
+
subject.new.cli_options.must_equal ''
|
12
|
+
end
|
13
|
+
|
14
|
+
it 'should be set with \'cli\'' do
|
15
|
+
subject.new(:cli => '--test').cli_options.must_equal '--test'
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
describe 'deprecated options' do
|
20
|
+
describe 'seed' do
|
21
|
+
it 'should set cli options' do
|
22
|
+
Guard::UI.expects(:info).with('DEPRECATION WARNING: The :seed option is deprecated. Pass standard command line argument "--seed" to MiniTest with the :cli option.')
|
23
|
+
subject.new(:seed => 123456789).cli_options.must_match /--seed 123456789/
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
describe 'verbose' do
|
28
|
+
it 'should set cli options' do
|
29
|
+
Guard::UI.expects(:info).with('DEPRECATION WARNING: The :verbose option is deprecated. Pass standard command line argument "--verbose" to MiniTest with the :cli option.')
|
30
|
+
subject.new(:verbose => true).cli_options.must_match /--verbose/
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
describe 'bundler' do
|
36
|
+
it 'default should be true if Gemfile exist' do
|
37
|
+
Dir.stubs(:pwd).returns(fixtures_path.join('bundler'))
|
38
|
+
subject.new.bundler?.must_equal true
|
39
|
+
end
|
40
|
+
|
41
|
+
it 'default should be false if Gemfile don\'t exist' do
|
42
|
+
Dir.stubs(:pwd).returns(fixtures_path.join('empty'))
|
43
|
+
subject.new.bundler?.must_equal false
|
44
|
+
end
|
45
|
+
|
46
|
+
it 'should be forced to false' do
|
47
|
+
Dir.stubs(:pwd).returns(fixtures_path.join('bundler'))
|
48
|
+
subject.new(:bundler => false).bundler?.must_equal false
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
describe 'rubygems' do
|
53
|
+
it 'default should be false if Gemfile exist' do
|
54
|
+
Dir.stubs(:pwd).returns(fixtures_path.join('bundler'))
|
55
|
+
subject.new.rubygems?.must_equal false
|
56
|
+
end
|
57
|
+
|
58
|
+
it 'default should be false if Gemfile don\'t exist' do
|
59
|
+
Dir.stubs(:pwd).returns(fixtures_path.join('empty'))
|
60
|
+
subject.new.rubygems?.must_equal false
|
61
|
+
end
|
62
|
+
|
63
|
+
it 'should be set to true if bundler is disabled' do
|
64
|
+
subject.new(:bundler => false, :rubygems => true).rubygems?.must_equal true
|
65
|
+
end
|
66
|
+
|
67
|
+
it 'should not be set to true if bundler is enabled' do
|
68
|
+
subject.new(:bundler => true, :rubygems => true).rubygems?.must_equal false
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
describe 'drb' do
|
73
|
+
it 'default should be false' do
|
74
|
+
subject.new.drb?.must_equal false
|
75
|
+
end
|
76
|
+
|
77
|
+
it 'should be set' do
|
78
|
+
subject.new(:drb => true).drb?.must_equal true
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
describe 'run' do
|
84
|
+
before(:each) do
|
85
|
+
Dir.stubs(:pwd).returns(fixtures_path.join('empty'))
|
86
|
+
@default_runner = File.expand_path('../../../../lib/guard/minitest/runners/default_runner.rb', __FILE__)
|
87
|
+
end
|
88
|
+
|
89
|
+
it 'should run with specified seed' do
|
90
|
+
runner = subject.new(:test_folders => %w[test], :cli => '--seed 12345')
|
91
|
+
runner.expects(:system).with(
|
92
|
+
"ruby -I\"test\" -r ./test/test_minitest.rb -r #{@default_runner} -e 'MiniTest::Unit.autorun' -- --seed 12345"
|
93
|
+
)
|
94
|
+
runner.run(['test/test_minitest.rb'])
|
95
|
+
end
|
96
|
+
|
97
|
+
it 'should run in verbose mode' do
|
98
|
+
runner = subject.new(:test_folders => %w[test], :cli => '--verbose')
|
99
|
+
runner.expects(:system).with(
|
100
|
+
"ruby -I\"test\" -r ./test/test_minitest.rb -r #{@default_runner} -e 'MiniTest::Unit.autorun' -- --verbose"
|
101
|
+
)
|
102
|
+
runner.run(['test/test_minitest.rb'])
|
103
|
+
end
|
104
|
+
|
105
|
+
describe 'in empty folder' do
|
106
|
+
|
107
|
+
before(:each) do
|
108
|
+
Dir.stubs(:pwd).returns(fixtures_path.join('empty'))
|
109
|
+
end
|
110
|
+
|
111
|
+
it 'should run without bundler and rubygems' do
|
112
|
+
runner = subject.new(:test_folders => %w[test])
|
113
|
+
Guard::UI.expects(:info)
|
114
|
+
runner.expects(:system).with(
|
115
|
+
"ruby -I\"test\" -r ./test/test_minitest.rb -r #{@default_runner} -e 'MiniTest::Unit.autorun'"
|
116
|
+
)
|
117
|
+
runner.run(['test/test_minitest.rb'])
|
118
|
+
end
|
119
|
+
|
120
|
+
it 'should run without bundler but rubygems' do
|
121
|
+
runner = subject.new(:test_folders => %w[test], :rubygems => true)
|
122
|
+
Guard::UI.expects(:info)
|
123
|
+
runner.expects(:system).with(
|
124
|
+
"ruby -I\"test\" -r rubygems -r ./test/test_minitest.rb -r #{@default_runner} -e 'MiniTest::Unit.autorun'"
|
125
|
+
)
|
126
|
+
runner.run(['test/test_minitest.rb'])
|
127
|
+
end
|
128
|
+
|
129
|
+
end
|
130
|
+
|
131
|
+
describe 'in bundler folder' do
|
132
|
+
before(:each) do
|
133
|
+
Dir.stubs(:pwd).returns(fixtures_path.join('bundler'))
|
134
|
+
end
|
135
|
+
|
136
|
+
it 'should run with bundler but not rubygems' do
|
137
|
+
runner = subject.new(:test_folders => %w[test], :bundler => true, :rubygems => false)
|
138
|
+
Guard::UI.expects(:info)
|
139
|
+
runner.expects(:system).with(
|
140
|
+
"bundle exec ruby -I\"test\" -r bundler/setup -r ./test/test_minitest.rb -r #{@default_runner} -e 'MiniTest::Unit.autorun'"
|
141
|
+
)
|
142
|
+
runner.run(['test/test_minitest.rb'])
|
143
|
+
end
|
144
|
+
|
145
|
+
it 'should run without bundler but rubygems' do
|
146
|
+
runner = subject.new(:test_folders => %w[test], :bundler => false, :rubygems => true)
|
147
|
+
Guard::UI.expects(:info)
|
148
|
+
runner.expects(:system).with(
|
149
|
+
"ruby -I\"test\" -r rubygems -r ./test/test_minitest.rb -r #{@default_runner} -e 'MiniTest::Unit.autorun'"
|
150
|
+
)
|
151
|
+
runner.run(['test/test_minitest.rb'], :bundler => false, :rubygems => true)
|
152
|
+
end
|
153
|
+
|
154
|
+
it 'should run without bundler and rubygems' do
|
155
|
+
runner = subject.new(:test_folders => %w[test], :bundler => false, :rubygems => false)
|
156
|
+
Guard::UI.expects(:info)
|
157
|
+
runner.expects(:system).with(
|
158
|
+
"ruby -I\"test\" -r ./test/test_minitest.rb -r #{@default_runner} -e 'MiniTest::Unit.autorun'"
|
159
|
+
)
|
160
|
+
runner.run(['test/test_minitest.rb'], :bundler => false, :rubygems => false)
|
161
|
+
end
|
162
|
+
|
163
|
+
end
|
164
|
+
|
165
|
+
describe 'drb' do
|
166
|
+
it 'should run with drb' do
|
167
|
+
runner = subject.new(:test_folders => %w[test], :drb => true)
|
168
|
+
Guard::UI.expects(:info)
|
169
|
+
runner.expects(:system).with('testdrb ./test/test_minitest.rb')
|
170
|
+
runner.run(['test/test_minitest.rb'], :drb => true)
|
171
|
+
end
|
172
|
+
|
173
|
+
end
|
174
|
+
end
|
175
|
+
end
|
@@ -0,0 +1,78 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'spec_helper'
|
3
|
+
|
4
|
+
describe Guard::Minitest do
|
5
|
+
subject { Guard::Minitest }
|
6
|
+
|
7
|
+
let(:runner) { stub('runner', :test_folders => [], :test_file_patterns => []) }
|
8
|
+
let(:inspector) { stub('inspector') }
|
9
|
+
let(:guard) { subject.new }
|
10
|
+
|
11
|
+
before(:each) do
|
12
|
+
Guard::Minitest::Runner.stubs(:new).returns(runner)
|
13
|
+
Guard::Minitest::Inspector.stubs(:new).returns(inspector)
|
14
|
+
end
|
15
|
+
|
16
|
+
after(:each) do
|
17
|
+
Guard::Minitest::Runner.unstub(:new)
|
18
|
+
Guard::Minitest::Inspector.unstub(:new)
|
19
|
+
end
|
20
|
+
|
21
|
+
describe 'initialization' do
|
22
|
+
|
23
|
+
it 'should initialize runner with options' do
|
24
|
+
Guard::Minitest::Runner.expects(:new).with({}).returns(runner)
|
25
|
+
subject.new
|
26
|
+
end
|
27
|
+
|
28
|
+
it 'should initialize inspector with options' do
|
29
|
+
Guard::Minitest::Inspector.expects(:new).with(runner.test_folders, runner.test_file_patterns).returns(inspector)
|
30
|
+
subject.new
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
34
|
+
|
35
|
+
describe 'start' do
|
36
|
+
|
37
|
+
it 'should return true' do
|
38
|
+
guard.start.must_equal true
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
42
|
+
|
43
|
+
describe 'stop' do
|
44
|
+
|
45
|
+
it 'should return true' do
|
46
|
+
guard.stop.must_equal true
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
50
|
+
|
51
|
+
describe 'reload' do
|
52
|
+
|
53
|
+
it 'should return true' do
|
54
|
+
guard.reload.must_equal true
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
58
|
+
|
59
|
+
describe 'run_all' do
|
60
|
+
|
61
|
+
it 'should run all tests' do
|
62
|
+
inspector.stubs(:clean_all).returns(['test/guard/minitest/test_inspector.rb', 'test/guard/test_minitest.rb'])
|
63
|
+
runner.expects(:run).with(['test/guard/minitest/test_inspector.rb', 'test/guard/test_minitest.rb'], {:message => 'Running all tests'}).returns(true)
|
64
|
+
guard.run_all.must_equal true
|
65
|
+
end
|
66
|
+
|
67
|
+
end
|
68
|
+
|
69
|
+
describe 'run_on_changes' do
|
70
|
+
|
71
|
+
it 'should run minitest in paths' do
|
72
|
+
inspector.stubs(:clean).with(['test/guard/minitest/test_inspector.rb']).returns(['test/guard/minitest/test_inspector.rb'])
|
73
|
+
runner.expects(:run).with(['test/guard/minitest/test_inspector.rb']).returns(true)
|
74
|
+
guard.run_on_changes(['test/guard/minitest/test_inspector.rb']).must_equal true
|
75
|
+
end
|
76
|
+
|
77
|
+
end
|
78
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'minitest/spec'
|
3
|
+
require 'mocha/setup'
|
4
|
+
|
5
|
+
require 'guard/minitest'
|
6
|
+
|
7
|
+
class MiniTest::Spec < MiniTest::Unit::TestCase
|
8
|
+
|
9
|
+
before(:each) do
|
10
|
+
ENV['GUARD_ENV'] = 'test'
|
11
|
+
@real_minitest_version = MiniTest::Unit::VERSION.dup
|
12
|
+
end
|
13
|
+
|
14
|
+
after(:each) do
|
15
|
+
ENV['GUARD_ENV'] = nil
|
16
|
+
@_memoized = nil
|
17
|
+
|
18
|
+
if MiniTest::Unit.const_defined?(:VERSION)
|
19
|
+
MiniTest::Unit::VERSION.replace(@real_minitest_version)
|
20
|
+
else
|
21
|
+
MiniTest::Unit.send(:const_set, :VERSION, @real_minitest_version)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.let(name, &block)
|
26
|
+
define_method name do
|
27
|
+
@_memoized ||= {}
|
28
|
+
@_memoized.fetch(name) { |k| @_memoized[k] = instance_eval(&block) }
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def self.subject(&block)
|
33
|
+
let :subject, &block
|
34
|
+
end
|
35
|
+
|
36
|
+
def fixtures_path
|
37
|
+
@fixtures_path ||= Pathname.new(File.expand_path('../fixtures/', __FILE__))
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
File without changes
|
File without changes
|
File without changes
|
metadata
ADDED
@@ -0,0 +1,231 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: guard-sporkminitest
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Yann Lugrin
|
9
|
+
- ☈king
|
10
|
+
autorequire:
|
11
|
+
bindir: bin
|
12
|
+
cert_chain: []
|
13
|
+
date: 2012-12-27 00:00:00.000000000 Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: guard
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
18
|
+
none: false
|
19
|
+
requirements:
|
20
|
+
- - ! '>='
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '0'
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
none: false
|
27
|
+
requirements:
|
28
|
+
- - ! '>='
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
version: '0'
|
31
|
+
- !ruby/object:Gem::Dependency
|
32
|
+
name: guard-spork
|
33
|
+
requirement: !ruby/object:Gem::Requirement
|
34
|
+
none: false
|
35
|
+
requirements:
|
36
|
+
- - ! '>='
|
37
|
+
- !ruby/object:Gem::Version
|
38
|
+
version: '0'
|
39
|
+
type: :runtime
|
40
|
+
prerelease: false
|
41
|
+
version_requirements: !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
43
|
+
requirements:
|
44
|
+
- - ! '>='
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0'
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: spork-minitest
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
type: :runtime
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: !ruby/object:Gem::Requirement
|
58
|
+
none: false
|
59
|
+
requirements:
|
60
|
+
- - ! '>='
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
63
|
+
- !ruby/object:Gem::Dependency
|
64
|
+
name: rb-inotify
|
65
|
+
requirement: !ruby/object:Gem::Requirement
|
66
|
+
none: false
|
67
|
+
requirements:
|
68
|
+
- - ! '>='
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: '0'
|
71
|
+
type: :runtime
|
72
|
+
prerelease: false
|
73
|
+
version_requirements: !ruby/object:Gem::Requirement
|
74
|
+
none: false
|
75
|
+
requirements:
|
76
|
+
- - ! '>='
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: '0'
|
79
|
+
- !ruby/object:Gem::Dependency
|
80
|
+
name: rb-fsevent
|
81
|
+
requirement: !ruby/object:Gem::Requirement
|
82
|
+
none: false
|
83
|
+
requirements:
|
84
|
+
- - ! '>='
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: '0'
|
87
|
+
type: :runtime
|
88
|
+
prerelease: false
|
89
|
+
version_requirements: !ruby/object:Gem::Requirement
|
90
|
+
none: false
|
91
|
+
requirements:
|
92
|
+
- - ! '>='
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '0'
|
95
|
+
- !ruby/object:Gem::Dependency
|
96
|
+
name: rake
|
97
|
+
requirement: !ruby/object:Gem::Requirement
|
98
|
+
none: false
|
99
|
+
requirements:
|
100
|
+
- - ! '>='
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '0'
|
103
|
+
type: :development
|
104
|
+
prerelease: false
|
105
|
+
version_requirements: !ruby/object:Gem::Requirement
|
106
|
+
none: false
|
107
|
+
requirements:
|
108
|
+
- - ! '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: minitest
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
none: false
|
115
|
+
requirements:
|
116
|
+
- - ! '>='
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: '0'
|
119
|
+
type: :development
|
120
|
+
prerelease: false
|
121
|
+
version_requirements: !ruby/object:Gem::Requirement
|
122
|
+
none: false
|
123
|
+
requirements:
|
124
|
+
- - ! '>='
|
125
|
+
- !ruby/object:Gem::Version
|
126
|
+
version: '0'
|
127
|
+
- !ruby/object:Gem::Dependency
|
128
|
+
name: bundler
|
129
|
+
requirement: !ruby/object:Gem::Requirement
|
130
|
+
none: false
|
131
|
+
requirements:
|
132
|
+
- - ! '>='
|
133
|
+
- !ruby/object:Gem::Version
|
134
|
+
version: '0'
|
135
|
+
type: :development
|
136
|
+
prerelease: false
|
137
|
+
version_requirements: !ruby/object:Gem::Requirement
|
138
|
+
none: false
|
139
|
+
requirements:
|
140
|
+
- - ! '>='
|
141
|
+
- !ruby/object:Gem::Version
|
142
|
+
version: '0'
|
143
|
+
- !ruby/object:Gem::Dependency
|
144
|
+
name: mocha
|
145
|
+
requirement: !ruby/object:Gem::Requirement
|
146
|
+
none: false
|
147
|
+
requirements:
|
148
|
+
- - ! '>='
|
149
|
+
- !ruby/object:Gem::Version
|
150
|
+
version: '0'
|
151
|
+
type: :development
|
152
|
+
prerelease: false
|
153
|
+
version_requirements: !ruby/object:Gem::Requirement
|
154
|
+
none: false
|
155
|
+
requirements:
|
156
|
+
- - ! '>='
|
157
|
+
- !ruby/object:Gem::Version
|
158
|
+
version: '0'
|
159
|
+
description: Guard test files for Spork-owned MiniTest
|
160
|
+
email:
|
161
|
+
- rking-guard-sporkminitest@sharpsaw.org
|
162
|
+
executables: []
|
163
|
+
extensions: []
|
164
|
+
extra_rdoc_files: []
|
165
|
+
files:
|
166
|
+
- .gemspec
|
167
|
+
- .gitignore
|
168
|
+
- .travis.yml
|
169
|
+
- Gemfile
|
170
|
+
- Guardfile
|
171
|
+
- LICENSE
|
172
|
+
- README.md
|
173
|
+
- Rakefile
|
174
|
+
- gemfiles/minitest-1.7
|
175
|
+
- gemfiles/minitest-2
|
176
|
+
- lib/guard/sporkminitest.rb
|
177
|
+
- lib/guard/sporkminitest/inspector.rb
|
178
|
+
- lib/guard/sporkminitest/notifier.rb
|
179
|
+
- lib/guard/sporkminitest/runner.rb
|
180
|
+
- lib/guard/sporkminitest/runners/default_runner.rb
|
181
|
+
- lib/guard/sporkminitest/runners/version_1_runner.rb
|
182
|
+
- lib/guard/sporkminitest/runners/version_2_runner.rb
|
183
|
+
- lib/guard/sporkminitest/templates/Guardfile
|
184
|
+
- lib/guard/sporkminitest/version.rb
|
185
|
+
- spec/fixtures/bundler/Gemfile
|
186
|
+
- spec/guard/minitest/inspector_spec.rb
|
187
|
+
- spec/guard/minitest/notifier_spec.rb
|
188
|
+
- spec/guard/minitest/runner_spec.rb
|
189
|
+
- spec/guard/minitest_spec.rb
|
190
|
+
- spec/spec_helper.rb
|
191
|
+
- test/guard/minitest/test_inspector.rb
|
192
|
+
- test/guard/minitest_test.rb
|
193
|
+
- test/guard/test_minitest.rb
|
194
|
+
homepage: https://github.com/rking/guard-minitest
|
195
|
+
licenses: []
|
196
|
+
post_install_message:
|
197
|
+
rdoc_options:
|
198
|
+
- --charset=UTF-8
|
199
|
+
- --main=README.rdoc
|
200
|
+
- --exclude='(lib|test|spec)|(Gem|Guard|Rake)file'
|
201
|
+
require_paths:
|
202
|
+
- lib
|
203
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
204
|
+
none: false
|
205
|
+
requirements:
|
206
|
+
- - ! '>='
|
207
|
+
- !ruby/object:Gem::Version
|
208
|
+
version: '0'
|
209
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
210
|
+
none: false
|
211
|
+
requirements:
|
212
|
+
- - ! '>='
|
213
|
+
- !ruby/object:Gem::Version
|
214
|
+
version: '0'
|
215
|
+
requirements: []
|
216
|
+
rubyforge_project:
|
217
|
+
rubygems_version: 1.8.24
|
218
|
+
signing_key:
|
219
|
+
specification_version: 3
|
220
|
+
summary: Guard test files for Spork-owned MiniTest
|
221
|
+
test_files:
|
222
|
+
- .gemspec
|
223
|
+
- lib/guard/sporkminitest/inspector.rb
|
224
|
+
- spec/fixtures/bundler/Gemfile
|
225
|
+
- spec/guard/minitest/inspector_spec.rb
|
226
|
+
- spec/guard/minitest/notifier_spec.rb
|
227
|
+
- spec/guard/minitest/runner_spec.rb
|
228
|
+
- spec/guard/minitest_spec.rb
|
229
|
+
- spec/spec_helper.rb
|
230
|
+
- test/guard/minitest/test_inspector.rb
|
231
|
+
has_rdoc:
|