diff options
author | Robin Dupret <robin.dupret@gmail.com> | 2012-10-14 12:03:39 +0200 |
---|---|---|
committer | Robin Dupret <robin.dupret@gmail.com> | 2012-10-14 18:26:58 +0200 |
commit | 5ad7f8ab418f0c760dbb584f7c78d94ce32e9ee3 (patch) | |
tree | 9e58227af8a363398a03b8010156d5a84d59dea9 /railties/lib/rails/test_unit | |
parent | ca618d473dcb9b5cc4000d057df9322376900622 (diff) | |
download | rails-5ad7f8ab418f0c760dbb584f7c78d94ce32e9ee3.tar.gz rails-5ad7f8ab418f0c760dbb584f7c78d94ce32e9ee3.tar.bz2 rails-5ad7f8ab418f0c760dbb584f7c78d94ce32e9ee3.zip |
Use Ruby 1.9 Hash syntax in railties
Diffstat (limited to 'railties/lib/rails/test_unit')
-rw-r--r-- | railties/lib/rails/test_unit/railtie.rb | 4 | ||||
-rw-r--r-- | railties/lib/rails/test_unit/testing.rake | 28 |
2 files changed, 16 insertions, 16 deletions
diff --git a/railties/lib/rails/test_unit/railtie.rb b/railties/lib/rails/test_unit/railtie.rb index 2b6170ebfb..ed89ce4128 100644 --- a/railties/lib/rails/test_unit/railtie.rb +++ b/railties/lib/rails/test_unit/railtie.rb @@ -1,8 +1,8 @@ module Rails class TestUnitRailtie < Rails::Railtie config.app_generators do |c| - c.test_framework :test_unit, :fixture => true, - :fixture_replacement => nil + c.test_framework :test_unit, fixture: true, + fixture_replacement: nil c.integration_tool :test_unit c.performance_tool :test_unit diff --git a/railties/lib/rails/test_unit/testing.rake b/railties/lib/rails/test_unit/testing.rake index 63cb955d44..cd59fbe599 100644 --- a/railties/lib/rails/test_unit/testing.rake +++ b/railties/lib/rails/test_unit/testing.rake @@ -43,7 +43,7 @@ module Kernel end end -task :default => :test +task default: :test desc 'Runs test:units, test:functionals, test:integration together (also available: test:benchmark, test:profile)' task :test do @@ -61,7 +61,7 @@ namespace :test do Rake::Task[task].invoke nil rescue => e - { :task => task, :exception => e } + { task: task, exception: e } end end.compact @@ -71,7 +71,7 @@ namespace :test do end end - Rake::TestTask.new(:recent => "test:prepare") do |t| + Rake::TestTask.new(recent: "test:prepare") do |t| since = TEST_CHANGES_SINCE touched = FileList['test/**/*_test.rb'].select { |path| File.mtime(path) > since } + recent_tests('app/models/**/*.rb', 'test/models', since) + @@ -84,7 +84,7 @@ namespace :test do end Rake::Task['test:recent'].comment = "Test recent changes" - Rake::TestTask.new(:uncommitted => "test:prepare") do |t| + Rake::TestTask.new(uncommitted: "test:prepare") do |t| def t.file_list if File.directory?(".svn") changed_since_checkin = silence_stderr { `svn status` }.split.map { |path| path.chomp[7 .. -1] } @@ -108,52 +108,52 @@ namespace :test do end Rake::Task['test:uncommitted'].comment = "Test changes since last checkin (only Subversion and Git)" - Rake::TestTask.new(:single => "test:prepare") do |t| + Rake::TestTask.new(single: "test:prepare") do |t| t.libs << "test" end - Rails::SubTestTask.new(:models => "test:prepare") do |t| + Rails::SubTestTask.new(models: "test:prepare") do |t| t.libs << "test" t.pattern = 'test/models/**/*_test.rb' end - Rails::SubTestTask.new(:helpers => "test:prepare") do |t| + Rails::SubTestTask.new(helpers: "test:prepare") do |t| t.libs << "test" t.pattern = 'test/helpers/**/*_test.rb' end - Rails::SubTestTask.new(:units => "test:prepare") do |t| + Rails::SubTestTask.new(units: "test:prepare") do |t| t.libs << "test" t.pattern = 'test/{models,helpers,unit}/**/*_test.rb' end - Rails::SubTestTask.new(:controllers => "test:prepare") do |t| + Rails::SubTestTask.new(controllers: "test:prepare") do |t| t.libs << "test" t.pattern = 'test/controllers/**/*_test.rb' end - Rails::SubTestTask.new(:mailers => "test:prepare") do |t| + Rails::SubTestTask.new(mailers: "test:prepare") do |t| t.libs << "test" t.pattern = 'test/mailers/**/*_test.rb' end - Rails::SubTestTask.new(:functionals => "test:prepare") do |t| + Rails::SubTestTask.new(functionals: "test:prepare") do |t| t.libs << "test" t.pattern = 'test/{controllers,mailers,functional}/**/*_test.rb' end - Rails::SubTestTask.new(:integration => "test:prepare") do |t| + Rails::SubTestTask.new(integration: "test:prepare") do |t| t.libs << "test" t.pattern = 'test/integration/**/*_test.rb' end - Rails::SubTestTask.new(:benchmark => 'test:prepare') do |t| + Rails::SubTestTask.new(benchmark: 'test:prepare') do |t| t.libs << 'test' t.pattern = 'test/performance/**/*_test.rb' t.options = '-- --benchmark' end - Rails::SubTestTask.new(:profile => 'test:prepare') do |t| + Rails::SubTestTask.new(profile: 'test:prepare') do |t| t.libs << 'test' t.pattern = 'test/performance/**/*_test.rb' end |