Skip to content

Commit 594d411

Browse files
lopopoloeregon
authored andcommitted
Use a StringScanner in strscan_concat_fixnum
`strscan_concat_fixnum` sends `:concat` to an empty `String` with a `Fixnum` argument and expects a `TypeError`. This is incorrect because `Fixnum` is a valid argument to `String#concat`. It is only `StringScanner` that disallows it.
1 parent ff678eb commit 594d411

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/stringscanner/shared/concat.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@
2525
x = mock('x')
2626
x.should_not_receive(:to_int)
2727

28-
lambda { "".send(@method, x) }.should raise_error(TypeError)
28+
lambda { StringScanner.new("").send(@method, x) }.should raise_error(TypeError)
2929
end
3030
end

0 commit comments

Comments
 (0)