sql_matchers 1.0.0.pre.rc.1 → 1.0.0.pre.rc.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sql_matchers/matchers/sql.rb +6 -1
- data/lib/sql_matchers/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ea820ab15f14da9e85e40d721cc0744edfabf5cf6b42dfbc89eebf714acbf74c
|
4
|
+
data.tar.gz: 60d94b0722065797839159faf66e985f0f3b85c1f317858a9b04a9b52e82f0e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '092790d059e6d1c066acd87b8c3a23b8bf59eb2677a8abf8bc554e754e358ff37440722a4625fbed7f1bd08518603756050e193a849dfb775653386109cb8576'
|
7
|
+
data.tar.gz: e1788fe82defea276dac318dd158afd96ba9a5551f79d2628428c5a26778868c95a80b5754db43a3e0fe2bfb536e91ed739f9f8d7db18c5effb279df134d0b61
|
@@ -5,6 +5,8 @@ require 'anbt-sql-formatter/formatter'
|
|
5
5
|
module SqlMatchers
|
6
6
|
module Matchers
|
7
7
|
class Sql
|
8
|
+
QUOTED_IDENT_RE = /[`"](\w+)[`"]/
|
9
|
+
|
8
10
|
attr_reader :actual, :expected
|
9
11
|
|
10
12
|
def initialize(expected)
|
@@ -21,7 +23,10 @@ module SqlMatchers
|
|
21
23
|
def diffable? = true
|
22
24
|
def matches?(actual)
|
23
25
|
@expected = formatter.format(+expected.to_s.strip)
|
24
|
-
|
26
|
+
.gsub(QUOTED_IDENT_RE, '\1')
|
27
|
+
|
28
|
+
@actual = formatter.format(+actual.to_s.strip)
|
29
|
+
.gsub(QUOTED_IDENT_RE, '\1')
|
25
30
|
|
26
31
|
@actual == @expected
|
27
32
|
end
|
data/lib/sql_matchers/version.rb
CHANGED