Skip to content

Commit

Permalink
remove quoted identifiers
Browse files Browse the repository at this point in the history
- this ensures that you can assert cross-adapter
  • Loading branch information
ezekg committed Aug 9, 2024
1 parent ee15939 commit 908bc4d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion lib/sql_matchers/matchers/sql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
module SqlMatchers
module Matchers
class Sql
QUOTED_IDENT_RE = /[`"](\w+)[`"]/

attr_reader :actual, :expected

def initialize(expected)
Expand All @@ -21,7 +23,10 @@ def initialize(expected)
def diffable? = true
def matches?(actual)
@expected = formatter.format(+expected.to_s.strip)
@actual = formatter.format(+actual.to_s.strip)
.gsub(QUOTED_IDENT_RE, '\1')

@actual = formatter.format(+actual.to_s.strip)
.gsub(QUOTED_IDENT_RE, '\1')

@actual == @expected
end
Expand Down
2 changes: 1 addition & 1 deletion lib/sql_matchers/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module SqlMatchers
VERSION = '1.0.0-rc.1'
VERSION = '1.0.0-rc.2'
end

0 comments on commit 908bc4d

Please sign in to comment.