diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2011-09-03 20:17:07 -0700 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2011-09-03 20:17:07 -0700 |
commit | 60b8bfa653713bae8bdca266d52f9d00d4acf189 (patch) | |
tree | fd7474d989ca79c655766109002e66b209529717 /railties/test | |
parent | 0a38e2a5ce2eaf7393958721edbfcf2a7fe87334 (diff) | |
parent | a6c60222c580e4002152b1ac1857673038b1fd42 (diff) | |
download | rails-60b8bfa653713bae8bdca266d52f9d00d4acf189.tar.gz rails-60b8bfa653713bae8bdca266d52f9d00d4acf189.tar.bz2 rails-60b8bfa653713bae8bdca266d52f9d00d4acf189.zip |
Merge pull request #2844 from arunagw/warnings_removed_master
Warnings removed from master
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/application/asset_debugging_test.rb | 8 | ||||
-rw-r--r-- | railties/test/application/assets_test.rb | 18 | ||||
-rw-r--r-- | railties/test/application/rake_test.rb | 6 | ||||
-rw-r--r-- | railties/test/generators/plugin_new_generator_test.rb | 6 | ||||
-rw-r--r-- | railties/test/generators/shared_generator_tests.rb | 4 | ||||
-rw-r--r-- | railties/test/railties/engine_test.rb | 2 | ||||
-rw-r--r-- | railties/test/railties/shared_tests.rb | 10 |
7 files changed, 27 insertions, 27 deletions
diff --git a/railties/test/application/asset_debugging_test.rb b/railties/test/application/asset_debugging_test.rb index 707abe7191..1b99af22a4 100644 --- a/railties/test/application/asset_debugging_test.rb +++ b/railties/test/application/asset_debugging_test.rb @@ -45,8 +45,8 @@ module ApplicationTests # the debug_assets params isn't used if compile is off get '/posts?debug_assets=true' - assert_match /<script src="\/assets\/application-([0-z]+)\.js" type="text\/javascript"><\/script>/, last_response.body - assert_no_match /<script src="\/assets\/xmlhr-([0-z]+)\.js" type="text\/javascript"><\/script>/, last_response.body + assert_match(/<script src="\/assets\/application-([0-z]+)\.js" type="text\/javascript"><\/script>/, last_response.body) + assert_no_match(/<script src="\/assets\/xmlhr-([0-z]+)\.js" type="text\/javascript"><\/script>/, last_response.body) end test "assets aren't concatened when compile is true is on and debug_assets params is true" do @@ -58,8 +58,8 @@ module ApplicationTests class ::PostsController < ActionController::Base ; end get '/posts?debug_assets=true' - assert_match /<script src="\/assets\/application-([0-z]+)\.js\?body=1" type="text\/javascript"><\/script>/, last_response.body - assert_match /<script src="\/assets\/xmlhr-([0-z]+)\.js\?body=1" type="text\/javascript"><\/script>/, last_response.body + assert_match(/<script src="\/assets\/application-([0-z]+)\.js\?body=1" type="text\/javascript"><\/script>/, last_response.body) + assert_match(/<script src="\/assets\/xmlhr-([0-z]+)\.js\?body=1" type="text\/javascript"><\/script>/, last_response.body) end end end diff --git a/railties/test/application/assets_test.rb b/railties/test/application/assets_test.rb index a412b7d99b..1e0a26918b 100644 --- a/railties/test/application/assets_test.rb +++ b/railties/test/application/assets_test.rb @@ -77,8 +77,8 @@ module ApplicationTests manifest = "#{app_path}/public/assets/manifest.yml" assets = YAML.load_file(manifest) - assert_match /application-([0-z]+)\.js/, assets["application.js"] - assert_match /application-([0-z]+)\.css/, assets["application.css"] + assert_match(/application-([0-z]+)\.js/, assets["application.js"]) + assert_match(/application-([0-z]+)\.css/, assets["application.css"]) end test "precompile creates a manifest file in a custom path with all the assets listed" do @@ -96,8 +96,8 @@ module ApplicationTests manifest = "#{app_path}/shared/manifest.yml" assets = YAML.load_file(manifest) - assert_match /application-([0-z]+)\.js/, assets["application.js"] - assert_match /application-([0-z]+)\.css/, assets["application.css"] + assert_match(/application-([0-z]+)\.js/, assets["application.js"]) + assert_match(/application-([0-z]+)\.css/, assets["application.css"]) end @@ -113,7 +113,7 @@ module ApplicationTests manifest = "#{app_path}/public/x/manifest.yml" assets = YAML.load_file(manifest) - assert_match /application-([0-z]+)\.js/, assets["application.js"] + assert_match(/application-([0-z]+)\.js/, assets["application.js"]) end test "precompile does not append asset digests when config.assets.digest is false" do @@ -176,8 +176,8 @@ module ApplicationTests class ::PostsController < ActionController::Base ; end get '/posts' - assert_match /AssetNotPrecompiledError/, last_response.body - assert_match /app.js isn't precompiled/, last_response.body + assert_match(/AssetNotPrecompiledError/, last_response.body) + assert_match(/app.js isn't precompiled/, last_response.body) end test "precompile appends the md5 hash to files referenced with asset_path and run in the provided RAILS_ENV" do @@ -189,7 +189,7 @@ module ApplicationTests Dir.chdir(app_path){ `bundle exec rake assets:precompile RAILS_ENV=test` } # end file = Dir["#{app_path}/public/assets/application-*.css"].first - assert_match /\/assets\/rails-([0-z]+)\.png/, File.read(file) + assert_match(/\/assets\/rails-([0-z]+)\.png/, File.read(file)) end test "precompile appends the md5 hash to files referenced with asset_path and run in production as default even using RAILS_GROUPS=assets" do @@ -201,7 +201,7 @@ module ApplicationTests Dir.chdir(app_path){ `bundle exec rake assets:precompile RAILS_GROUPS=assets` } end file = Dir["#{app_path}/public/assets/application-*.css"].first - assert_match /\/assets\/rails-([0-z]+)\.png/, File.read(file) + assert_match(/\/assets\/rails-([0-z]+)\.png/, File.read(file)) end test "assets are cleaned up properly" do diff --git a/railties/test/application/rake_test.rb b/railties/test/application/rake_test.rb index cc65a674c9..0e03c3dc2d 100644 --- a/railties/test/application/rake_test.rb +++ b/railties/test/application/rake_test.rb @@ -79,9 +79,9 @@ module ApplicationTests silence_stderr do output = Dir.chdir(app_path){ `rake test` } - assert_match /Errors running test:units! #<ActiveRecord::AdapterNotSpecified/, output - assert_match /Errors running test:functionals! #<RuntimeError/, output - assert_match /Errors running test:integration! #<RuntimeError/, output + assert_match(/Errors running test:units! #<ActiveRecord::AdapterNotSpecified/, output) + assert_match(/Errors running test:functionals! #<RuntimeError/, output) + assert_match(/Errors running test:integration! #<RuntimeError/, output) end end diff --git a/railties/test/generators/plugin_new_generator_test.rb b/railties/test/generators/plugin_new_generator_test.rb index b49945f153..9183945619 100644 --- a/railties/test/generators/plugin_new_generator_test.rb +++ b/railties/test/generators/plugin_new_generator_test.rb @@ -197,8 +197,8 @@ class PluginNewGeneratorTest < Rails::Generators::TestCase assert_file "app/helpers/bukkits/application_helper.rb", /module Bukkits\n module ApplicationHelper/ assert_file "app/views/layouts/bukkits/application.html.erb" do |contents| assert_match "<title>Bukkits</title>", contents - assert_match /stylesheet_link_tag\s+['"]bukkits\/application['"]/, contents - assert_match /javascript_include_tag\s+['"]bukkits\/application['"]/, contents + assert_match(/stylesheet_link_tag\s+['"]bukkits\/application['"]/, contents) + assert_match(/javascript_include_tag\s+['"]bukkits\/application['"]/, contents) end end @@ -241,7 +241,7 @@ class PluginNewGeneratorTest < Rails::Generators::TestCase run_generator [destination_root, "--skip-test-unit"] assert_no_file "test" assert_file "bukkits.gemspec" do |contents| - assert_no_match /s.test_files = Dir\["test\/\*\*\/\*"\]/, contents + assert_no_match(/s.test_files = Dir\["test\/\*\*\/\*"\]/, contents) end end diff --git a/railties/test/generators/shared_generator_tests.rb b/railties/test/generators/shared_generator_tests.rb index d3074afd91..1534f0d828 100644 --- a/railties/test/generators/shared_generator_tests.rb +++ b/railties/test/generators/shared_generator_tests.rb @@ -191,11 +191,11 @@ module SharedCustomGeneratorTests end def test_builder_option_with_http - path = "http://gist.github.com/103208.txt" + url = "http://gist.github.com/103208.txt" template = "class #{builder_class}; end" template.instance_eval "def read; self; end" # Make the string respond to read - generator([destination_root], :builder => path).expects(:open).with(path, 'Accept' => 'application/x-thor-template').returns(template) + generator([destination_root], :builder => url).expects(:open).with(url, 'Accept' => 'application/x-thor-template').returns(template) quietly { generator.invoke_all } default_files.each{ |path| assert_no_file(path) } diff --git a/railties/test/railties/engine_test.rb b/railties/test/railties/engine_test.rb index 0ff1e0f180..06a60cd858 100644 --- a/railties/test/railties/engine_test.rb +++ b/railties/test/railties/engine_test.rb @@ -400,7 +400,7 @@ module RailtiesTest boot_rails get("/bukkits/posts/new") - assert_match /name="post\[title\]"/, last_response.body + assert_match(/name="post\[title\]"/, last_response.body) end test "isolated engine should set correct route module prefix for nested namespace" do diff --git a/railties/test/railties/shared_tests.rb b/railties/test/railties/shared_tests.rb index 9a64b7c64e..6ed99c76de 100644 --- a/railties/test/railties/shared_tests.rb +++ b/railties/test/railties/shared_tests.rb @@ -61,21 +61,21 @@ module RailtiesTest assert File.exists?("#{app_path}/db/migrate/2_create_users.rb") assert File.exists?("#{app_path}/db/migrate/3_add_last_name_to_users.rb") - assert_match /Copied migration 2_create_users.rb from bukkits/, output - assert_match /Copied migration 3_add_last_name_to_users.rb from bukkits/, output - assert_match /NOTE: Migration 3_create_sessions.rb from bukkits has been skipped/, output + assert_match(/Copied migration 2_create_users.rb from bukkits/, output) + assert_match(/Copied migration 3_add_last_name_to_users.rb from bukkits/, output) + assert_match(/NOTE: Migration 3_create_sessions.rb from bukkits has been skipped/, output) assert_equal 3, Dir["#{app_path}/db/migrate/*.rb"].length output = `bundle exec rake railties:install:migrations`.split("\n") assert File.exists?("#{app_path}/db/migrate/4_create_yaffles.rb") - assert_no_match /2_create_users/, output.join("\n") + assert_no_match(/2_create_users/, output.join("\n")) yaffle_migration_order = output.index(output.detect{|o| /Copied migration 4_create_yaffles.rb from acts_as_yaffle/ =~ o }) bukkits_migration_order = output.index(output.detect{|o| /NOTE: Migration 3_create_sessions.rb from bukkits has been skipped/ =~ o }) assert_not_nil yaffle_migration_order, "Expected migration to be copied" assert_not_nil bukkits_migration_order, "Expected migration to be skipped" - assert_equal (railties.index('acts_as_yaffle') > railties.index('bukkits')) , (yaffle_migration_order > bukkits_migration_order) + assert_equal((railties.index('acts_as_yaffle') > railties.index('bukkits')) , (yaffle_migration_order > bukkits_migration_order)) migrations_count = Dir["#{app_path}/db/migrate/*.rb"].length output = `bundle exec rake railties:install:migrations` |