diff options
author | Mike Gunderloy <MikeG1@larkfarm.com> | 2008-12-28 10:57:37 -0600 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2008-12-28 17:49:58 +0000 |
commit | 1fb275541a58e6a2100261c6117e96e6c014cc6c (patch) | |
tree | 24085ff7b288b34794e354739481829fefb52ca0 | |
parent | fec0ea9d6d4ca56a09e3e83002c38d69c8ad924e (diff) | |
download | rails-1fb275541a58e6a2100261c6117e96e6c014cc6c.tar.gz rails-1fb275541a58e6a2100261c6117e96e6c014cc6c.tar.bz2 rails-1fb275541a58e6a2100261c6117e96e6c014cc6c.zip |
Ensure template runner tests don't depend on hash ordering [#1654 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
-rw-r--r-- | railties/lib/rails_generator/generators/applications/app/template_runner.rb | 2 | ||||
-rw-r--r-- | railties/test/generators/rails_template_runner_test.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/railties/lib/rails_generator/generators/applications/app/template_runner.rb b/railties/lib/rails_generator/generators/applications/app/template_runner.rb index 7f2e086271..bb7bd0e6f4 100644 --- a/railties/lib/rails_generator/generators/applications/app/template_runner.rb +++ b/railties/lib/rails_generator/generators/applications/app/template_runner.rb @@ -89,7 +89,7 @@ module Rails gems_code = "config.gem '#{name}'" if options.any? - opts = options.inject([]) {|result, h| result << [":#{h[0]} => '#{h[1]}'"] }.join(", ") + opts = options.inject([]) {|result, h| result << [":#{h[0]} => '#{h[1]}'"] }.sort.join(", ") gems_code << ", #{opts}" end diff --git a/railties/test/generators/rails_template_runner_test.rb b/railties/test/generators/rails_template_runner_test.rb index 07507a16c4..fcc020603d 100644 --- a/railties/test/generators/rails_template_runner_test.rb +++ b/railties/test/generators/rails_template_runner_test.rb @@ -79,7 +79,7 @@ class RailsTemplateRunnerTest < GeneratorTestCase def test_gem_with_options_should_include_options_in_gem_dependency_in_environment run_template_method(:gem, 'mislav-will-paginate', :lib => 'will-paginate', :source => 'http://gems.github.com') - assert_rails_initializer_includes("config.gem 'mislav-will-paginate', :source => 'http://gems.github.com', :lib => 'will-paginate'") + assert_rails_initializer_includes("config.gem 'mislav-will-paginate', :lib => 'will-paginate', :source => 'http://gems.github.com'") end def test_environment_should_include_data_in_environment_initializer_block |