Sha256: ecee3a305d848678d2a90635d1cd30ed83a28f44c8559cc684b10f8d9f0e1e35

Contents?: true

Size: 819 Bytes

Versions: 4

Compression:

Stored size: 819 Bytes

Contents

# Remarkable core module
module Remarkable
  # A module that keeps all matchers added. This is useful because it allows
  # to include matchers in Test::Unit as well.
  module Matchers; end

  # Helper that includes required Remarkable modules into the given klass.
  #
  # If the module to be included responds to :after_include, it's called with the
  # target as argument.
  #
  def self.include_matchers!(base, target)
    target.send :extend, Remarkable::Pending
    target.send :extend, Remarkable::Macros

    if defined?(base::Matchers)
      target.send :include, base::Matchers

      Remarkable::Matchers.send :extend, base::Matchers
      Remarkable::Matchers.send :include, base::Matchers
    end

    if base.respond_to?(:after_include)
      base.after_include(target)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
remarkable-3.0.10 lib/remarkable/matchers.rb
remarkable-3.1.1 lib/remarkable/matchers.rb
remarkable-3.1.0 lib/remarkable/matchers.rb
remarkable-3.1.2 lib/remarkable/matchers.rb