Skip to content

Commit

Permalink
tests, reset global to previous value.
Browse files Browse the repository at this point in the history
The default of the global might change. It's better to reset it to
what it was than a hardcoded value.
  • Loading branch information
senny committed Feb 9, 2015
1 parent c6a36ef commit 8ba7548
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion railties/test/generators/named_base_test.rb
Expand Up @@ -49,11 +49,13 @@ def test_named_generator_attributes_as_ruby
end

def test_named_generator_attributes_without_pluralized
original_pluralize_table_names = ActiveRecord::Base.pluralize_table_names
ActiveRecord::Base.pluralize_table_names = false

g = generator ['admin/foo']
assert_name g, 'admin_foo', :table_name
ensure
ActiveRecord::Base.pluralize_table_names = true
ActiveRecord::Base.pluralize_table_names = original_pluralize_table_names
end

def test_scaffold_plural_names
Expand Down

0 comments on commit 8ba7548

Please sign in to comment.