grimen-dry_scaffold 0.3.2 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -63,7 +63,7 @@ class DryModelGenerator < DryGenerator
|
|
|
63
63
|
model_tests_path = File.join(TEST_PATHS[test_framework], UNIT_TESTS_PATH[test_framework])
|
|
64
64
|
m.directory File.join(model_tests_path, class_path)
|
|
65
65
|
m.template File.join('models', 'tests', "#{test_framework}", 'unit_test.rb'),
|
|
66
|
-
File.join(model_tests_path, class_path, "#{file_name}
|
|
66
|
+
File.join(model_tests_path, class_path, "#{file_name}_#{TEST_POST_FIX[test_framework]}.rb")
|
|
67
67
|
|
|
68
68
|
# Fixtures/Factories.
|
|
69
69
|
if options[:fixtures]
|
|
@@ -145,7 +145,7 @@ class DryScaffoldGenerator < DryGenerator
|
|
|
145
145
|
controller_tests_path = File.join(TEST_PATHS[test_framework], FUNCTIONAL_TESTS_PATH[test_framework])
|
|
146
146
|
m.directory File.join(controller_tests_path, controller_class_path)
|
|
147
147
|
m.template File.join('controllers', 'tests', "#{test_framework}", 'functional_test.rb'),
|
|
148
|
-
File.join(controller_tests_path, controller_class_path, "#{controller_file_name}
|
|
148
|
+
File.join(controller_tests_path, controller_class_path, "#{controller_file_name}_controller_#{TEST_POST_FIX[test_framework]}.rb")
|
|
149
149
|
end
|
|
150
150
|
|
|
151
151
|
# Helpers.
|
|
@@ -156,10 +156,10 @@ class DryScaffoldGenerator < DryGenerator
|
|
|
156
156
|
|
|
157
157
|
# Helper Tests
|
|
158
158
|
unless options[:skip_tests]
|
|
159
|
-
helper_tests_path = File.join(TEST_PATHS[test_framework], '
|
|
159
|
+
helper_tests_path = File.join(TEST_PATHS[test_framework], 'helpers')
|
|
160
160
|
m.directory File.join(helper_tests_path, controller_class_path)
|
|
161
161
|
m.template File.join('helpers', 'tests', "#{test_framework}", 'unit_test.rb'),
|
|
162
|
-
File.join(helper_tests_path, controller_class_path, "#{controller_file_name}
|
|
162
|
+
File.join(helper_tests_path, controller_class_path, "#{controller_file_name}_helper_#{TEST_POST_FIX[test_framework]}.rb")
|
|
163
163
|
end
|
|
164
164
|
end
|
|
165
165
|
|
data/lib/dry_generator.rb
CHANGED
|
@@ -59,6 +59,12 @@ class DryGenerator < Rails::Generator::NamedBase
|
|
|
59
59
|
:rspec => 'spec'
|
|
60
60
|
}.freeze
|
|
61
61
|
|
|
62
|
+
TEST_POST_FIX = {
|
|
63
|
+
:test_unit => 'test',
|
|
64
|
+
:shoulda => 'test',
|
|
65
|
+
:rspec => 'spec'
|
|
66
|
+
}.freeze
|
|
67
|
+
|
|
62
68
|
DEFAULT_TEST_FRAMEWORK = :test_unit
|
|
63
69
|
DEFAULT_FACTORY_FRAMEWORK = :fixtures
|
|
64
70
|
|