Sha256: e36d0b6efa01414abde6b8a1effc2dcde3634a615044b48c95b614e7142aff9c

Contents?: true

Size: 992 Bytes

Versions: 1

Compression:

Stored size: 992 Bytes

Contents

module RSpec::Rails
  module Model
    include RSpec::Rails::BaseHelper

    def model_file_name name, options=nil
      artifact_path name, :model
    end        
      
    def create_model name, options={}, &block
      create_artifact(name, set(options, :model), &block)
    end  

    def insert_into_model(name, options={}, &block)
      insert_content(name, set(options, :model), &block)      
    end

    def read_model(name, options={}, &block)
      read_artifact(name, set(options, :model), &block)      
    end

    def remove_model name
      remove_artifact name, :model
    end

    def remove_models *names
      remove_artifacts :model, *names
    end

    def model_marker name, options={}
      return send :orm_marker_name, options[:model_type] if respond_to?(:orm_marker_name)
      name.camelize      
    end

    aliases_for :model
    
    def orm_notify
      ". You must specify an ORM with the macro use_orm, f.ex -- use_orm :active_record"
    end    
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
generator-spec-0.5.0 lib/generator_spec/rails_helpers/rails_model.rb