File tree 2 files changed +8
-3
lines changed
2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 76
76
# Ensure that the sql files passed are valid file paths.
77
77
if $sql {
78
78
$sql .each | $sqlfile | {
79
- if $sqlfile !~ /^\/(?:[ A-Za-z0-9_-]+\/?+)+(?:.[ A-Za-z0-9]+)$/ {
80
- $message = " The file '${sqlfile} ' is invalid. A a valid file path is expected."
79
+ if $sqlfile !~ /^\/(?:.[. A-Za-z0-9_-]+\/?+)+(?:\.[. A-Za-z0-9]+)+ $/ {
80
+ $message = " The file '${sqlfile} ' is invalid. A valid file path is expected."
81
81
fail($message )
82
82
}
83
83
}
Original file line number Diff line number Diff line change 94
94
] . each do |path |
95
95
it "fails when provided '#{ path } ' as a value to the 'sql' parameter" do
96
96
params [ 'sql' ] = [ path ]
97
- is_expected . to raise_error ( Puppet ::PreformattedError , %r{The file '#{ Regexp . escape ( path ) } ' is invalid. A a valid file path is expected.} )
97
+ is_expected . to raise_error ( Puppet ::PreformattedError , %r{The file '#{ Regexp . escape ( path ) } ' is invalid. A valid file path is expected.} )
98
98
end
99
99
end
100
100
103
103
'/tmp/test.txt' ,
104
104
'/tmp/.test' ,
105
105
'/foo.test' ,
106
+ '/foo.test.txt' ,
107
+ '/foo/test/test-1.2.3/schema/test.sql' ,
108
+ '/foo/test/test-1.2.3/schema/foo.test.sql' ,
109
+ '/foo/foo.t1.t2.t3/foo.test-1.2.3/test.test.schema/test..app.sql' ,
110
+ '/foo/foo.t1.t2...t3/foo.test-1.2.3/test.test.schema/test.app.sql' ,
106
111
] . each do |path |
107
112
it "succeeds when provided '#{ path } ' as a value to the 'sql' parameter" do
108
113
params [ 'sql' ] = [ path ]
You can’t perform that action at this time.
0 commit comments