Sha256: 8d5ffe52224d3d3ddff5ee5b6aad4306b7df0b73e7dd95757dfbe2e8a2f0588c
Contents?: true
Size: 627 Bytes
Versions: 42
Compression:
Stored size: 627 Bytes
Contents
require 'generators/rspec' module Rspec module Generators class ModelGenerator < Base argument :attributes, :type => :array, :default => [], :banner => "field:type field:type" class_option :fixture, :type => :boolean def create_test_file template 'model_spec.rb', File.join('spec/models', class_path, "#{file_name}_spec.rb") end hook_for :fixture_replacement def create_fixture_file if options[:fixture] && options[:fixture_replacement].nil? template 'fixtures.yml', File.join('spec/fixtures', "#{table_name}.yml") end end end end end
Version data entries
42 entries across 42 versions & 2 rubygems