Skip to content

Commit 8288abb

Browse files
committed
Fix old syntax from inspect breaking tests
1 parent 85b0b95 commit 8288abb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/rich-text/op.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,10 @@ def to_json(*args)
135135
# RichText::Op.new(:insert, 'abc', { bold: true }).inspect(false) => 'insert="abc" {:bold=>true}'
136136
def inspect(wrap = true)
137137
str = "#{type}=#{value.inspect}"
138-
str << " #{attributes.inspect}" if attributes?
138+
if attributes?
139+
formatted_attrs = attributes.map { |k,v| "#{k.inspect}=>#{v.inspect}" }.join(', ')
140+
str << " {#{formatted_attrs}}"
141+
end
139142
wrap ? "#<#{self.class.name} #{str}>" : str
140143
end
141144

0 commit comments

Comments
 (0)