Sha256: 6888e8a467b4d147b463ff51d952dcdf147269eb1ccece479a5e504a4d1828c8

Contents?: true

Size: 998 Bytes

Versions: 1

Compression:

Stored size: 998 Bytes

Contents

module RSpec::Rails
  module Observer
    include RSpec::Rails::BaseHelper

    def observer_file_name name, options=nil
      artifact_path name, :observer
    end
        
    def create_observer name, options={}, &block
      create_artifact(name, set(options, :observer), &block)
    end  

    def insert_into_observer(name, options={}, &block)
      insert_content(name, set(options, :observer), &block)      
    end

    def read_observer(name, options={}, &block)
      read_artifact(name, set(options, :observer), &block)      
    end

    def remove_observer name
      remove_artifact name, :observer
    end

    def remove_observers *names      
      remove_artifacts :observer, *names
    end      

    def observer_marker name, options=nil
      "#{name.to_s.camelize}Observer < ActiveRecord::Observer"
    end

    def new_observer_content name, content=nil, &block
      new_artifact_content name, :observer, content, &block
    end
    
    aliases_for :observer    
  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_observer.rb