Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' into all_after_pass

  • Loading branch information...
commit 7ebe061581fbb9237b12fbf591d47eedf1324469 2 parents 004a3aa + 513d28f
@deivid-rodriguez deivid-rodriguez authored
View
1  .travis.yml
@@ -3,6 +3,7 @@ bundler_args: --without development
rvm:
- 1.9.3
- 2.0.0
+ - 2.1.0
- jruby-19mode
- rbx
gemfile:
View
6 Guardfile
@@ -1,5 +1,5 @@
guard :minitest do
- watch(%r{^spec/(.*)_spec\.rb})
- watch(%r{^(lib/.*/)?([^/]+)\.rb}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
- watch(%r{^spec/spec_helper\.rb}) { 'spec' }
+ watch(%r{^spec/(.*)_spec\.rb$})
+ watch(%r{^(lib/.*/)?([^/]+)\.rb$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
+ watch(%r{^spec/spec_helper\.rb$}) { 'spec' }
end
View
12 README.md
@@ -70,9 +70,9 @@ Please read [guard doc](http://github.com/guard/guard#readme) for more info abou
```ruby
guard :minitest do
- watch(%r{^test/(.*)\/?test_(.*)\.rb})
- watch(%r{^lib/(.*/)?([^/]+)\.rb}) { |m| "test/#{m[1]}test_#{m[2]}.rb" }
- watch(%r{^test/test_helper\.rb}) { 'test' }
+ watch(%r{^test/(.*)\/?test_(.*)\.rb$})
+ watch(%r{^lib/(.*/)?([^/]+)\.rb$}) { |m| "test/#{m[1]}test_#{m[2]}.rb" }
+ watch(%r{^test/test_helper\.rb$}) { 'test' }
end
```
@@ -80,9 +80,9 @@ end
```ruby
guard :minitest do
- watch(%r{^spec/(.*)_spec\.rb})
- watch(%r{^lib/(.+)\.rb}) { |m| "spec/#{m[1]}_spec.rb" }
- watch(%r{^spec/spec_helper\.rb}) { 'spec' }
+ watch(%r{^spec/(.*)_spec\.rb$})
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
+ watch(%r{^spec/spec_helper\.rb$}) { 'spec' }
end
```
View
4 lib/guard/minitest.rb
@@ -35,8 +35,8 @@ def run_all
runner.run_all
end
- def run_on_changes(paths = [])
- runner.run_on_changes(paths)
+ def run_on_modifications(paths = [])
+ runner.run_on_modifications(paths)
end
def run_on_additions(paths)
View
4 lib/guard/minitest/runner.rb
@@ -62,14 +62,14 @@ def run_all
run(paths, all: true)
end
- def run_on_changes(paths = [])
+ def run_on_modifications(paths = [])
paths = inspector.clean(paths)
run(paths, all: all_paths?(paths))
end
def run_on_additions(paths)
inspector.clear_memoized_test_files
- run(paths)
+ true
end
def run_on_removals(paths)
View
30 lib/guard/minitest/templates/Guardfile
@@ -1,25 +1,25 @@
guard :minitest do
# with Minitest::Unit
- watch(%r{^test/(.*)\/?test_(.*)\.rb})
- watch(%r{^lib/(.*/)?([^/]+)\.rb}) { |m| "test/#{m[1]}test_#{m[2]}.rb" }
- watch(%r{^test/test_helper\.rb}) { 'test' }
+ watch(%r{^test/(.*)\/?test_(.*)\.rb$})
+ watch(%r{^lib/(.*/)?([^/]+)\.rb$}) { |m| "test/#{m[1]}test_#{m[2]}.rb" }
+ watch(%r{^test/test_helper\.rb$}) { 'test' }
# with Minitest::Spec
- # watch(%r{^spec/(.*)_spec\.rb})
- # watch(%r{^lib/(.+)\.rb}) { |m| "spec/#{m[1]}_spec.rb" }
- # watch(%r{^spec/spec_helper\.rb}) { 'spec' }
+ # watch(%r{^spec/(.*)_spec\.rb$})
+ # watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
+ # watch(%r{^spec/spec_helper\.rb$}) { 'spec' }
# Rails 4
- # watch(%r{^app/(.+)\.rb}) { |m| "test/#{m[1]}_test.rb" }
- # watch(%r{^app/controllers/application_controller\.rb}) { 'test/controllers' }
- # watch(%r{^app/controllers/(.+)_controller\.rb}) { |m| "test/integration/#{m[1]}_test.rb" }
+ # watch(%r{^app/(.+)\.rb$}) { |m| "test/#{m[1]}_test.rb" }
+ # watch(%r{^app/controllers/application_controller\.rb$}) { 'test/controllers' }
+ # watch(%r{^app/controllers/(.+)_controller\.rb$}) { |m| "test/integration/#{m[1]}_test.rb" }
# watch(%r{^app/views/(.+)_mailer/.+}) { |m| "test/mailers/#{m[1]}_mailer_test.rb" }
- # watch(%r{^lib/(.+)\.rb}) { |m| "test/lib/#{m[1]}_test.rb" }
- # watch(%r{^test/.+_test\.rb})
- # watch(%r{^test/test_helper\.rb}) { 'test' }
+ # watch(%r{^lib/(.+)\.rb$}) { |m| "test/lib/#{m[1]}_test.rb" }
+ # watch(%r{^test/.+_test\.rb$})
+ # watch(%r{^test/test_helper\.rb$}) { 'test' }
# Rails < 4
- # watch(%r{^app/controllers/(.*)\.rb}) { |m| "test/functional/#{m[1]}_test.rb" }
- # watch(%r{^app/helpers/(.*)\.rb}) { |m| "test/helpers/#{m[1]}_test.rb" }
- # watch(%r{^app/models/(.*)\.rb}) { |m| "test/unit/#{m[1]}_test.rb" }
+ # watch(%r{^app/controllers/(.*)\.rb$}) { |m| "test/functional/#{m[1]}_test.rb" }
+ # watch(%r{^app/helpers/(.*)\.rb$}) { |m| "test/helpers/#{m[1]}_test.rb" }
+ # watch(%r{^app/models/(.*)\.rb$}) { |m| "test/unit/#{m[1]}_test.rb" }
end
View
11 spec/lib/guard/minitest/runner_spec.rb
@@ -387,7 +387,7 @@
end
end
- describe 'run_on_changes' do
+ describe 'run_on_modifications' do
let(:runner) { subject.new }
before do
@@ -404,7 +404,7 @@
it 'runs minitest in all paths' do
runner.expects(:run).with(@paths, all: true).returns(true)
- runner.run_on_changes(@paths).must_equal true
+ runner.run_on_modifications(@paths).must_equal true
end
it 'does not run all tests again after success even when all_after_pass is enabled' do
@@ -412,7 +412,7 @@
new_runner.stubs(:system).returns(true)
new_runner.expects(:run_all).never
- new_runner.run_on_changes(@paths).must_equal true
+ new_runner.run_on_modifications(@paths).must_equal true
end
end
@@ -424,7 +424,7 @@
it 'runs minitest in paths' do
runner.expects(:run).with(['test/test_minitest_1.rb'], all: false).returns(true)
- runner.run_on_changes(@paths).must_equal true
+ runner.run_on_modifications(@paths).must_equal true
end
it 'runs all tests again after success if all_after_pass enabled' do
@@ -432,7 +432,7 @@
new_runner.stubs(:system).returns(true)
new_runner.expects(:run).with(@paths, all: true).returns(true)
- new_runner.run_on_changes(@paths).must_equal true
+ new_runner.run_on_modifications(@paths).must_equal true
end
end
end
@@ -442,7 +442,6 @@
runner = subject.new
runner.inspector.stubs(:clean).with(['test/guard/minitest/test_new.rb']).returns(['test/guard/minitest/test_new.rb'])
runner.inspector.expects(:clear_memoized_test_files)
- runner.expects(:run).with(['test/guard/minitest/test_new.rb']).returns(true)
runner.run_on_additions(['test/guard/minitest/test_new.rb']).must_equal true
end
View
10 spec/lib/guard/minitest_spec.rb
@@ -40,18 +40,18 @@
end
end
- describe 'run_on_changes' do
- it 'runs run_on_changes via runner' do
- runner.any_instance.expects(:run_on_changes)
+ describe 'run_on_modifications' do
+ it 'is run through runner' do
+ runner.any_instance.expects(:run_on_modifications)
- guard.run_on_changes
+ guard.run_on_modifications
end
end
describe 'run_on_additions' do
let(:paths) { %w[path1 path2] }
- it 'runs run_on_additions via runner' do
+ it 'is run through runner' do
runner.any_instance.expects(:run_on_additions).with(paths)
guard.run_on_additions(paths)
Please sign in to comment.
Something went wrong with that request. Please try again.