module Shoulda::Matchers
Constants
- AssertionError
@private
- TERMINAL_MAX_WIDTH
- VERSION
@private
Public Class Methods
nunit_test_case_constants()
click to toggle source
@private
# File lib/shoulda/matchers/integrations/nunit_test_case_detection.rb, line 35 def self.nunit_test_case_constants Integrations::NUnitTestCaseDetection.test_case_constants 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, TERMINAL_MAX_WIDTH) 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(text, width=80)
click to toggle source
Source: <www.ruby-forum.com/topic/57805> @private
# File lib/shoulda/matchers/warn.rb, line 29 def self.word_wrap(text, width=80) text. gsub(/\n+/, " "). gsub( /(\S{#{width}})(?=\S)/, '\1 ' ). gsub( /(.{1,#{width}})(?:\s+|$)/, "\\1\n" ) end