1
0
Fork 0
mirror of https://github.com/thoughtbot/shoulda-matchers.git synced 2022-11-09 12:01:38 -05:00

User string.new to inspect String

This commit is contained in:
Gui Vieira 2019-12-29 20:43:39 -08:00
parent ef4284cb16
commit a959060498
2 changed files with 4 additions and 2 deletions

View file

@ -82,7 +82,7 @@ module Shoulda
end
def set
object.public_send("#{attribute_name}=".to_sym, value_written)
object.public_send("#{attribute_name}=", value_written)
after_set_callback.call
@result_of_checking = successful_check
@ -135,7 +135,7 @@ module Shoulda
end
def value_read
@_value_read ||= object.public_send(attribute_name.to_sym)
@_value_read ||= String.new(object.public_send(attribute_name))
end
def attribute_changed_value?

View file

@ -48,6 +48,8 @@ module Shoulda
inspect_hash(value)
when Range
inspect_range(value)
when String
String.new(value)
else
"#{value.inspect}"
end