Skip to content

Commit 7edb9ab

Browse files
committed
Add test
1 parent 31db419 commit 7edb9ab

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

spec/lib/annotate/annotate_models_spec.rb

+14
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,20 @@ def mock_column(name, type, options = {})
152152
is_expected.to eq(['1.2'])
153153
end
154154
end
155+
156+
context 'when the argument is an object that responds to to_s' do
157+
let(:value) do
158+
obj = Object.new
159+
def obj.to_s
160+
"custom string representation"
161+
end
162+
obj
163+
end
164+
165+
it 'returns the result of to_s wrapped in quotes' do
166+
is_expected.to eq('"custom string representation"')
167+
end
168+
end
155169
end
156170

157171
describe '.parse_options' do

0 commit comments

Comments
 (0)