Class: Minitest::Generators::RouteGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/minitest/route/route_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject


15
16
17
# File 'lib/generators/minitest/route/route_generator.rb', line 15

def self.source_root
  @source_root ||= File.expand_path(File.join(File.dirname(__FILE__), 'templates'))
end

Instance Method Details

#create_test_filesObject


19
20
21
22
23
24
25
# File 'lib/generators/minitest/route/route_generator.rb', line 19

def create_test_files
  if options[:spec]
    template "route_spec.rb", File.join("test", "routes", "route_test.rb")
  else
    template "route_test.rb", File.join("test", "routes", "route_test.rb")
  end
end