Sha256: 84bce525fce113fc2825c0ef9fc1b22a4317c0b48ce9641e8d78eb8786a0a94b

Contents?: true

Size: 1.48 KB

Versions: 1

Compression:

Stored size: 1.48 KB

Contents

module TestReporter
  
  class Called < Exception
    attr_accessor :middleware, :env
    def initialize(middleware:, env:)
      @middleware = middleware
      @env = env
    end
  end

  module Notify
    def self.included(base)
      base.send :include, Enableable
    end

    def after(env)
      return unless middleware = enabled_middleware(TestReporter, env)
      raise Called, middleware: middleware, env: env
    end
  end

  module Middleware
    module Query
      module Exec ;                     include Notify ; end
    end

    module Schema
      module Tables ;                   include Notify ; end
      module Indexes ;                  include Notify ; end
    end

    module Migration
      module Column ;                   include Notify ; end
      module Index ;                    include Notify ; end
    end

    module Sql
      module ColumnOptions ;            include Notify ; end
      module IndexComponents ;          include Notify ; end
      module Table ;                    include Notify ; end
    end

    module Model
      module Columns ;                  include Notify ; end
      module ResetColumnInformation ;   include Notify ; end
    end

    module Dumper
      module Initial ;                  include Notify ; end
      module Tables ;                   include Notify ; end
      module Table ;                    include Notify ; end
      module Indexes ;                  include Notify ; end
    end
  end
end

SchemaMonkey.register(TestReporter)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
schema_plus_core-0.1.0 spec/support/test_reporter.rb