Skip to content

Commit

Permalink
\n has been ignored
Browse files Browse the repository at this point in the history
  • Loading branch information
gongo committed Jun 8, 2016
1 parent 02f743d commit 79b9115
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/turnip/placeholder.rb
Expand Up @@ -77,7 +77,7 @@ def find_match(value)
# %{'Jhon Doe'}
#
# In any case, it passed to the step block in the state without quotes
return @default, value.sub(/^(["'])(.*)\1$/, '\2')
return @default, value.sub(/^(["'])([^\1]*)\1$/, '\2')
end

def placeholder_matches
Expand Down
3 changes: 3 additions & 0 deletions spec/placeholder_spec.rb
Expand Up @@ -105,6 +105,9 @@
expect(placeholder.apply('John Doe')).to eq('John Doe')
expect(placeholder.apply('"John Doe"')).to eq('John Doe')
expect(placeholder.apply('\'John Doe\'')).to eq('John Doe')

expect(placeholder.apply('John \n Doe')).to eq('John \n Doe')
expect(placeholder.apply('"John \n Doe"')).to eq('John \n Doe')
end
end

Expand Down

0 comments on commit 79b9115

Please sign in to comment.