Class: Rspec::Generators::ModelGenerator

Inherits:
Base
  • Object
show all
Defined in:
lib/generators/rspec/model/model_generator.rb

Instance Method Summary collapse

Methods inherited from Base

source_root

Instance Method Details

#create_fixture_fileObject



15
16
17
18
19
# File 'lib/generators/rspec/model/model_generator.rb', line 15

def create_fixture_file
  if options[:fixture] && options[:fixture_replacement].nil?
    template 'fixtures.yml', File.join('spec/fixtures', "#{table_name}.yml")
  end
end

#create_model_specObject



9
10
11
# File 'lib/generators/rspec/model/model_generator.rb', line 9

def create_model_spec
  template 'model_spec.rb', File.join('spec/models', class_path, "#{file_name}_spec.rb")
end