mirror of
https://github.com/thoughtbot/shoulda-matchers.git
synced 2022-11-09 12:01:38 -05:00
29 lines
517 B
Ruby
29 lines
517 B
Ruby
module Shoulda
|
|
module Matchers
|
|
# @private
|
|
class Error < StandardError
|
|
def self.create(attributes)
|
|
allocate.tap do |error|
|
|
attributes.each do |name, value|
|
|
error.__send__("#{name}=", value)
|
|
end
|
|
|
|
error.__send__(:initialize)
|
|
end
|
|
end
|
|
|
|
def initialize(*args)
|
|
super
|
|
@message = message
|
|
end
|
|
|
|
def message
|
|
''
|
|
end
|
|
|
|
def inspect
|
|
%(#<#{self.class}: #{message}>)
|
|
end
|
|
end
|
|
end
|
|
end
|