Sha256: c1dce2301b04e87a01cfaf48f1c6c5e55e9bf46e05a400652c432a3b10d1d975
Contents?: true
Size: 628 Bytes
Versions: 61
Compression:
Stored size: 628 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_model_spec 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
61 entries across 56 versions & 6 rubygems