Skip to content

Commit

Permalink
Ensure template runner tests don't depend on hash ordering [#1654 sta…
Browse files Browse the repository at this point in the history
…te:resolved]

Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
  • Loading branch information
Mike Gunderloy authored and lifo committed Dec 28, 2008
1 parent fec0ea9 commit 1fb2755
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Expand Up @@ -89,7 +89,7 @@ def gem(name, options = {})
gems_code = "config.gem '#{name}'" gems_code = "config.gem '#{name}'"


if options.any? 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}" gems_code << ", #{opts}"
end end


Expand Down
2 changes: 1 addition & 1 deletion railties/test/generators/rails_template_runner_test.rb
Expand Up @@ -79,7 +79,7 @@ def test_gem_should_put_gem_dependency_in_enviroment


def test_gem_with_options_should_include_options_in_gem_dependency_in_environment 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') 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 end


def test_environment_should_include_data_in_environment_initializer_block def test_environment_should_include_data_in_environment_initializer_block
Expand Down

0 comments on commit 1fb2755

Please sign in to comment.