module Shoulda::Matchers

Constants

TERMINAL_MAX_WIDTH
VERSION

@private

Attributes

assertion_exception_class[RW]

@private

Public Class Methods

configuration() click to toggle source

@private

# File lib/shoulda/matchers/configuration.rb, line 9
def self.configuration
  @_configuration ||= Configuration.new
end
configure() { |configuration| ... } click to toggle source

@private

# File lib/shoulda/matchers/configuration.rb, line 4
def self.configure
  yield configuration
end
warn(message) click to toggle source

@private

# File lib/shoulda/matchers/warn.rb, line 6
def self.warn(message)
  header = "Warning from shoulda-matchers:"
  divider = "*" * TERMINAL_MAX_WIDTH
  wrapped_message = word_wrap(message)
  full_message = [
    divider,
    [header, wrapped_message.strip].join("\n\n"),
    divider
  ].join("\n")

  Kernel.warn(full_message)
end
warn_about_deprecated_method(old_method, new_method) click to toggle source

@private

# File lib/shoulda/matchers/warn.rb, line 20
    def self.warn_about_deprecated_method(old_method, new_method)
      warn <<EOT
#{old_method} is deprecated and will be removed in the next major
release. Please use #{new_method} instead.
EOT
    end
word_wrap(document, options = {}) click to toggle source

@private

# File lib/shoulda/matchers/util/word_wrap.rb, line 4
def self.word_wrap(document, options = {})
  Document.new(document, **options).wrap
end