Sha256: 19e548fd57ddba283d899bcec66f69456d1e0ae7e2f1d90dd9a7369c77ec9da0

Contents?: true

Size: 775 Bytes

Versions: 1

Compression:

Stored size: 775 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::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

1 entries across 1 versions & 1 rubygems

Version Path
remarkable-3.0.9 lib/remarkable/matchers.rb