Skip to content

Single quotes need to be escaped #10

@Ch0ronomato

Description

@Ch0ronomato

This test will throw a syntax error because of the single quotes:

Feature: Imma feature
  Background:
    Given the SQL files in the path "/sql":
      | file                      |
      | testing_things.sql        |
    And their table dependencies:
      | table                     |
      | schema.table            |


    Scenario: Adopted customer
      Given the existing table schema.table with date placeholders:
        | name |
	| This has 'quotes' | 
      When the given SQL files are executed and the result is returned
      Then the result exactly matches:
        | name |
        | This has 'quotes' |

ERROR: syntax error at or near "quotes" squcumber-app | LINE 1: ...sert into schema.table (name) values ('This has 'quotes'')

where name is varchar(255)

in order to make the test pass, we need to escape the quotes

Feature: Imma feature
  Background:
    Given the SQL files in the path "/sql":
      | file                      |
      | testing_things.sql        |
    And their table dependencies:
      | table                     |
      | schema.table            |


    Scenario: Adopted customer
      Given the existing table schema.table with date placeholders:
        | name |
	| This has ''quotes'' | 
      When the given SQL files are executed and the result is returned
      Then the result exactly matches:
        | name |
        | This has 'quotes' |

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions