Skip to content

Commit 08e7847

Browse files
committed
quote numbers in tests
1 parent 86dbe4c commit 08e7847

File tree

1 file changed

+16
-0
lines changed
  • test/excludes/ActiveRecord/ConnectionAdapters/PostgreSQLAdapter

1 file changed

+16
-0
lines changed

test/excludes/ActiveRecord/ConnectionAdapters/PostgreSQLAdapter/QuotingTest.rb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,19 @@
44
exclude :test_do_not_raise_when_int_is_not_wider_than_64bit, comment
55
exclude :test_do_not_raise_when_raise_int_wider_than_64bit_is_false, comment
66
exclude :test_raise_when_int_is_wider_than_64bit, comment
7+
8+
require "support/copy_cat"
9+
10+
CopyCat.copy_methods(self, self,
11+
:test_quote_big_decimal,
12+
:test_quote_rational,
13+
:test_quote_integer) do
14+
def on_str(node)
15+
return if defined?(@already_quoted)
16+
@already_quoted = true
17+
node => [:str, str]
18+
return unless ["4.2", "3/4", "42"].include?(str)
19+
20+
replace(node.loc.expression, "'#{str}'".inspect)
21+
end
22+
end

0 commit comments

Comments
 (0)