Skip to content

Commit

Permalink
fixed regex
Browse files Browse the repository at this point in the history
  • Loading branch information
Gal Dubitski committed Jul 23, 2018
1 parent 7211ee3 commit db632fb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion features/gherkin/request-options.feature
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Feature: Set request options

Scenario: Attach an XML file using utf-8 encoding
Given I request POST method at "https://httpbin.org/anything" url
And I add an attachment with name "myxml" and filename as "test.xml" with encoding "utf-8" using content:
And I add an attachment with name "myxml" and filename as "test.xml" with "utf-8" encoding using content:
"""
<?xml version="1.0" encoding="UTF-8"?>
<note>
Expand Down
6 changes: 3 additions & 3 deletions step-definitions/request-options.steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ Given(/I attach a|the file at "([^"]+)"(?: path) with name "([^"]+)"/, function
expect(this.client).to.exist;
return this.client.attach({ name, path });
});
Given(/I add an attachment with name "([^"]+)" and|having filename(?: as)? "([^"]+)" with|using "([^"]+)"(?:( base64)? data)/, function (name, filename, data, isBase64) {
Given(/I add an attachment with name "([^"]+)" (?:and|having) filename(?: as)? "([^"]+)" (?:with|using) "([^"]+)"(?:( base64)? data)/, function (name, filename, data, isBase64) {
expect(this.client).to.exist;
return this.client.attach({ name, filename, buffer: new Buffer(data, isBase64 ? 'base64' : 'utf8') });
});
Given(/I add an attachment with name "([^"]+)" and|having filename(?: as)? "([^"]+)" using "([^"]+)" buffer(?: with "([^"]+)" encoding)?/, function (name, filename, buffer, encoding) {
Given(/I add an attachment with name "([^"]+)" (?:and|having) filename(?: as)? "([^"]+)" using "([^"]+)" buffer(?: with "([^"]+)" encoding)?/, function (name, filename, buffer, encoding) {
expect(this.client).to.exist;
return this.client.attach({ name, filename, buffer: new Buffer(buffer, encoding || 'base64') });
});
Given(/I add an attachment with name "([^"]+)" and|having filename(?: as)? with "([^"]+)" encoding)? using content:/, function (name, filename, encoding, content) {
Given(/I add an attachment with name "([^"]+)" (?:and|having) filename(?: as)? "([^"]+)"( with "([^"]+)" encoding)? using content:/, function (name, filename, encoding, content) {
expect(this.client).to.exist;
return this.client.attach({ name, filename, buffer: new Buffer(content, encoding || 'utf8') });
});
Expand Down

0 comments on commit db632fb

Please sign in to comment.