diff options
author | José Valim <jose.valim@gmail.com> | 2011-12-20 17:51:26 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-12-20 17:59:26 +0100 |
commit | 9cf38be008aff555b3aecc53a6f18800cea30a71 (patch) | |
tree | 971681e6a49b1d55c674ffc39bd49559ab010333 /railties/test | |
parent | 500ca98fef7a8cc20f1f8f5835091e1f119e0d8a (diff) | |
download | rails-9cf38be008aff555b3aecc53a6f18800cea30a71.tar.gz rails-9cf38be008aff555b3aecc53a6f18800cea30a71.tar.bz2 rails-9cf38be008aff555b3aecc53a6f18800cea30a71.zip |
Get rid of --old-style-hash
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/generators/app_generator_test.rb | 13 | ||||
-rw-r--r-- | railties/test/generators/mailer_generator_test.rb | 23 | ||||
-rw-r--r-- | railties/test/generators/scaffold_controller_generator_test.rb | 13 |
3 files changed, 4 insertions, 45 deletions
diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb index c456347e5c..7ac222d84f 100644 --- a/railties/test/generators/app_generator_test.rb +++ b/railties/test/generators/app_generator_test.rb @@ -337,18 +337,7 @@ class AppGeneratorTest < Rails::Generators::TestCase def test_new_hash_style run_generator [destination_root] assert_file "config/initializers/session_store.rb" do |file| - if RUBY_VERSION < "1.9" - assert_match(/config.session_store :cookie_store, :key => '_.+_session'/, file) - else - assert_match(/config.session_store :cookie_store, key: '_.+_session'/, file) - end - end - end - - def test_force_old_style_hash - run_generator [destination_root, "--old-style-hash"] - assert_file "config/initializers/session_store.rb" do |file| - assert_match(/config.session_store :cookie_store, :key => '_.+_session'/, file) + assert_match(/config.session_store :cookie_store, key: '_.+_session'/, file) end end diff --git a/railties/test/generators/mailer_generator_test.rb b/railties/test/generators/mailer_generator_test.rb index 139d6b1421..63a97404ee 100644 --- a/railties/test/generators/mailer_generator_test.rb +++ b/railties/test/generators/mailer_generator_test.rb @@ -77,33 +77,14 @@ class MailerGeneratorTest < Rails::Generators::TestCase assert_file "app/mailers/notifier.rb" do |mailer| assert_instance_method :foo, mailer do |foo| - if RUBY_VERSION < "1.9" - assert_match(/mail :to => "to@example.org"/, foo) - else - assert_match(/mail to: "to@example.org"/, foo) - end + assert_match(/mail to: "to@example.org"/, foo) assert_match(/@greeting = "Hi"/, foo) end assert_instance_method :bar, mailer do |bar| - if RUBY_VERSION < "1.9" - assert_match(/mail :to => "to@example.org"/, bar) - else - assert_match(/mail to: "to@example.org"/, bar) - end + assert_match(/mail to: "to@example.org"/, bar) assert_match(/@greeting = "Hi"/, bar) end end end - - def test_force_old_style_hash - run_generator ["notifier", "foo", "--old-style-hash"] - assert_file "app/mailers/notifier.rb" do |mailer| - assert_match(/default :from => "from@example.com"/, mailer) - - assert_instance_method :foo, mailer do |foo| - assert_match(/mail :to => "to@example.org"/, foo) - end - end - end end diff --git a/railties/test/generators/scaffold_controller_generator_test.rb b/railties/test/generators/scaffold_controller_generator_test.rb index 65b30b9fbd..1382133d7b 100644 --- a/railties/test/generators/scaffold_controller_generator_test.rb +++ b/railties/test/generators/scaffold_controller_generator_test.rb @@ -126,18 +126,7 @@ class ScaffoldControllerGeneratorTest < Rails::Generators::TestCase def test_new_hash_style run_generator assert_file "app/controllers/users_controller.rb" do |content| - if RUBY_VERSION < "1.9" - assert_match(/\{ render :action => "new" \}/, content) - else - assert_match(/\{ render action: "new" \}/, content) - end - end - end - - def test_force_old_style_hash - run_generator ["User", "--old-style-hash"] - assert_file "app/controllers/users_controller.rb" do |content| - assert_match(/\{ render :action => "new" \}/, content) + assert_match(/\{ render action: "new" \}/, content) end end end |