Utilisation de minitest avec guard

This commit is contained in:
echarp 2013-11-25 18:26:50 +01:00
parent 21fae253da
commit e32e58a58a
3 changed files with 21 additions and 18 deletions

View File

@ -54,5 +54,5 @@ gem 'compass-rails', "~> 2.0.alpha.0"
group :development do group :development do
gem 'guard-livereload' gem 'guard-livereload'
gem 'guard-bundler' gem 'guard-bundler'
gem 'guard-test' gem 'guard-minitest'
end end

View File

@ -102,9 +102,9 @@ GEM
em-websocket (~> 0.5) em-websocket (~> 0.5)
guard (~> 2.0) guard (~> 2.0)
multi_json (~> 1.8) multi_json (~> 1.8)
guard-test (2.0.3) guard-minitest (2.1.2)
guard (~> 2.0) guard (~> 2.0)
test-unit (~> 2.2) minitest (>= 3.0)
haml (4.0.4) haml (4.0.4)
tilt tilt
haml-rails (0.4) haml-rails (0.4)
@ -145,7 +145,7 @@ GEM
mime-types (~> 1.16) mime-types (~> 1.16)
treetop (~> 1.4.8) treetop (~> 1.4.8)
method_source (0.8.2) method_source (0.8.2)
mime-types (1.25) mime-types (1.25.1)
minitest (4.7.5) minitest (4.7.5)
multi_json (1.8.2) multi_json (1.8.2)
mysql2 (0.3.14) mysql2 (0.3.14)
@ -206,7 +206,6 @@ GEM
actionpack (>= 3.0) actionpack (>= 3.0)
activesupport (>= 3.0) activesupport (>= 3.0)
sprockets (~> 2.8) sprockets (~> 2.8)
test-unit (2.5.5)
thor (0.18.1) thor (0.18.1)
thread_safe (0.1.3) thread_safe (0.1.3)
atomic atomic
@ -235,7 +234,7 @@ DEPENDENCIES
font-awesome-rails font-awesome-rails
guard-bundler guard-bundler
guard-livereload guard-livereload
guard-test guard-minitest
haml-rails haml-rails
jbuilder jbuilder
jquery-rails jquery-rails

View File

@ -1,18 +1,6 @@
# A sample Guardfile # A sample Guardfile
# More info at https://github.com/guard/guard#readme # More info at https://github.com/guard/guard#readme
guard :test do
watch(%r{^test/.+_test\.rb$})
watch('test/test_helper.rb') { 'test' }
# 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/views/(.+)_mailer/.+}) { |m| "test/mailers/#{m[1]}_mailer_test.rb" }
watch(%r{^lib/(.+)\.rb}) { |m| "test/lib/#{m[1]}_test.rb" }
end
guard :livereload do guard :livereload do
watch(%r{app/views/.+\.(erb|haml|slim)$}) watch(%r{app/views/.+\.(erb|haml|slim)$})
watch(%r{app/helpers/.+\.rb}) watch(%r{app/helpers/.+\.rb})
@ -21,3 +9,19 @@ guard :livereload do
# Rails Assets Pipeline # Rails Assets Pipeline
watch(%r{(app|vendor)(/assets/\w+/(.+\.(css|js|html))).*}) { |m| "/assets/#{m[3]}" } watch(%r{(app|vendor)(/assets/\w+/(.+\.(css|js|html))).*}) { |m| "/assets/#{m[3]}" }
end end
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' }
# 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/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' }
end