Class: Minitest::Generators::ControllerGenerator

Inherits:
Base
  • Object
show all
Defined in:
lib/generators/minitest/controller/controller_generator.rb

Instance Method Summary collapse

Methods inherited from Base

default_source_root

Instance Method Details

#create_test_filesObject


9
10
11
12
13
14
15
16
17
# File 'lib/generators/minitest/controller/controller_generator.rb', line 9

def create_test_files
  if options[:spec]
    template_file = "controller_spec.rb"
  else
    template_file = "controller_test.rb"
  end
  template template_file,
           File.join("test/controllers", class_path, "#{file_name}_controller_test.rb")
end