From 7c69559d9869f830323cd67a3c45656f5e44aafa Mon Sep 17 00:00:00 2001 From: Chris Johnson Date: Mon, 24 Jun 2019 14:24:45 -0400 Subject: [PATCH] Add spec --- spec/sql_footprint/sql_anonymizer_spec.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/spec/sql_footprint/sql_anonymizer_spec.rb b/spec/sql_footprint/sql_anonymizer_spec.rb index e2d113e..9e61931 100644 --- a/spec/sql_footprint/sql_anonymizer_spec.rb +++ b/spec/sql_footprint/sql_anonymizer_spec.rb @@ -66,6 +66,13 @@ ) end + it 'handles multi-line VALUES' do + sql = 'INSERT INTO "widgets" ("created_at", "name") VALUES ' \ + "('2016-05-1 6 19:16:04.981048', 'asdf\nasdf') RETURNING \"id\"" + expect(anonymizer.anonymize(sql)).to eq 'INSERT INTO "widgets" ' \ + '("created_at", "name") VALUES (values-redacted) RETURNING "id"' + end + context 'with a custom rule' do let(:redacted) { 'SELECT [redacted] AS [redacted]'.freeze }