From 0288324b4fbe9571aa568cc05eab35eee8ddaf29 Mon Sep 17 00:00:00 2001 From: Martin Linkhorst Date: Wed, 24 Oct 2012 16:12:22 +0200 Subject: [PATCH] added guard-test for test unit, yay --- Gemfile | 9 +++++++-- Gemfile.lock | 11 +++++++---- Guardfile | 12 ++++++++++++ 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/Gemfile b/Gemfile index ad539b770e..a16f8a573b 100644 --- a/Gemfile +++ b/Gemfile @@ -54,8 +54,8 @@ group :test do # TODO: remove dependency to v 1.1.3 when pry-debugger is updated to > 0.2 gem 'debugger', '~> 1.1.3', :platforms => [:mri_19, :mingw_19] - # remove in rails 3.2 - gem 'turn', '~> 0.8.3', :require => false + # why in Gemfile? see: https://github.com/guard/guard-test + gem 'ruby-prof' end group :openid do @@ -78,6 +78,11 @@ group :development, :test do gem 'pry-doc' end +group :tools do + # why tools? see: https://github.com/guard/guard-test + gem 'guard-test' +end + group :rmagick do gem "rmagick", ">= 1.15.17" # Older distributions might not have a sufficiently new ImageMagick version diff --git a/Gemfile.lock b/Gemfile.lock index 7b07223008..f3ccd75ea0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -45,7 +45,6 @@ GEM activesupport (3.1.8) multi_json (>= 1.0, < 1.3) addressable (2.3.2) - ansi (1.4.3) arel (2.2.3) awesome_nested_set (2.1.5) activerecord (>= 3.0.0) @@ -114,6 +113,9 @@ GEM guard-rspec (2.1.0) guard (>= 1.1) rspec (~> 2.11) + guard-test (0.5.0) + guard (>= 1.1.0) + test-unit (~> 2.2) hike (1.2.1) htmldiff (0.0.1) i18n (0.6.1) @@ -226,6 +228,7 @@ GEM ruby-debug-base (0.10.4) linecache (>= 0.3) ruby-openid (2.1.8) + ruby-prof (0.11.2) rubytree (0.8.3) json (>= 1.7.5) structured_warnings (>= 0.1.3) @@ -257,6 +260,7 @@ GEM sqlite3 (1.3.6) sqlite3-ruby (1.2.5) structured_warnings (0.1.3) + test-unit (2.5.2) thor (0.14.6) tilt (1.3.3) tinymce-rails (3.5.7.1) @@ -266,8 +270,6 @@ GEM treetop (1.4.11) polyglot polyglot (>= 0.3.1) - turn (0.8.3) - ansi tzinfo (0.3.33) uglifier (1.3.0) execjs (>= 0.3.0) @@ -297,6 +299,7 @@ DEPENDENCIES fastercsv (~> 1.5.0) globalize3! guard-rspec + guard-test htmldiff jquery-rails jruby-openssl @@ -323,6 +326,7 @@ DEPENDENCIES rspec-rails (~> 2.0) ruby-debug ruby-openid (~> 2.1.4) + ruby-prof rubytree (~> 0.8.3) safe_attributes sass-rails (~> 3.1.5) @@ -331,5 +335,4 @@ DEPENDENCIES sqlite3-ruby (< 1.3) tinymce-rails tinymce-rails-langs - turn (~> 0.8.3) uglifier (>= 1.0.3) diff --git a/Guardfile b/Guardfile index b9a900d536..238c4ff5d7 100644 --- a/Guardfile +++ b/Guardfile @@ -18,3 +18,15 @@ guard :rspec do watch(%r{^spec/acceptance/(.+)\.feature$}) watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance' } end + +guard :test do + watch(%r{^lib/(.+)\.rb$}) { |m| "test/#{m[1]}_test.rb" } + watch(%r{^test/.+_test\.rb$}) + watch('test/test_helper.rb') { "test" } + + # Rails example + 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/views/.+\.rb$}) { "test/integration" } + watch('app/controllers/application_controller.rb') { ["test/functional", "test/integration"] } +end