Browse files

Refactor generators tests to include test helpers in the parent class

  • Loading branch information...
1 parent fe45712 commit 8df46eac766ecdb1baadeddf3b93eacc6386c086 @carlosantoniodasilva carlosantoniodasilva committed Nov 27, 2012
Showing with 3 additions and 4 deletions.
  1. +3 −4 railties/test/generators/namespaced_generators_test.rb
View
7 railties/test/generators/namespaced_generators_test.rb
@@ -6,13 +6,15 @@
require 'rails/generators/rails/scaffold/scaffold_generator'
class NamespacedGeneratorTestCase < Rails::Generators::TestCase
+ include GeneratorsTestHelper
+
def setup
+ super
Rails::Generators.namespace = TestApp
end
end
class NamespacedControllerGeneratorTest < NamespacedGeneratorTestCase
- include GeneratorsTestHelper
arguments %w(Account foo bar)
tests Rails::Generators::ControllerGenerator
@@ -81,7 +83,6 @@ def test_namespaced_controller_dont_indent_blank_lines
end
class NamespacedModelGeneratorTest < NamespacedGeneratorTestCase
- include GeneratorsTestHelper
arguments %w(Account name:string age:integer)
tests Rails::Generators::ModelGenerator
@@ -142,7 +143,6 @@ def test_invokes_default_test_framework
end
class NamespacedObserverGeneratorTest < NamespacedGeneratorTestCase
- include GeneratorsTestHelper
arguments %w(account)
tests Rails::Generators::ObserverGenerator
@@ -163,7 +163,6 @@ def test_invokes_default_test_framework
end
class NamespacedMailerGeneratorTest < NamespacedGeneratorTestCase
- include GeneratorsTestHelper
arguments %w(notifier foo bar)
tests Rails::Generators::MailerGenerator

0 comments on commit 8df46ea

Please sign in to comment.