diff options
author | Prem Sichanugrist <s@sikachu.com> | 2011-04-10 12:30:58 +0800 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2011-04-10 16:47:51 +0800 |
commit | 74960c3976a69b3c7d9aa6bf28edb42ea82df0ce (patch) | |
tree | c589bace5fc2cb711d145ee82b9120197cc2c00f /railties/test/generators | |
parent | 63cd92f9f346acefca1ad014873c971837843cdb (diff) | |
download | rails-74960c3976a69b3c7d9aa6bf28edb42ea82df0ce.tar.gz rails-74960c3976a69b3c7d9aa6bf28edb42ea82df0ce.tar.bz2 rails-74960c3976a69b3c7d9aa6bf28edb42ea82df0ce.zip |
Rails will now generate Ruby 1.9 style hash when running app generator on Ruby 1.9.x
The new hash syntax of Ruby 1.9 looks more superior, so we decide to switch to it in the places that appropriate.
Diffstat (limited to 'railties/test/generators')
-rw-r--r-- | railties/test/generators/app_generator_test.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb index 018c2fa6bf..e440885adf 100644 --- a/railties/test/generators/app_generator_test.rb +++ b/railties/test/generators/app_generator_test.rb @@ -216,6 +216,16 @@ class AppGeneratorTest < Rails::Generators::TestCase end end + 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 protected def action(*args, &block) |