Skip to content

Commit a8e171f

Browse files
committed
Add test for curl binary opt
1 parent e75aafd commit a8e171f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/targets/shell/curl.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,17 @@ module.exports = function (HTTPSnippet, fixtures) {
1515
result.should.eql("curl -X POST 'http://mockbin.com/har?foo=bar&foo=baz&baz=abc&key=value' -H 'accept: application/json' -H 'content-type: application/x-www-form-urlencoded' -b 'foo=bar; bar=baz' -d foo=bar")
1616
})
1717

18+
it('should use binary option', function () {
19+
var result = new HTTPSnippet(fixtures.requests.full).convert('shell', 'curl', {
20+
short: true,
21+
indent: false,
22+
binary: true
23+
})
24+
25+
result.should.be.a.String
26+
result.should.eql("curl -X POST 'http://mockbin.com/har?foo=bar&foo=baz&baz=abc&key=value' -H 'accept: application/json' -H 'content-type: application/x-www-form-urlencoded' -b 'foo=bar; bar=baz' --data-binary foo=bar")
27+
})
28+
1829
it('should use --http1.0 for HTTP/1.0', function () {
1930
var result = new HTTPSnippet(fixtures.curl.http1).convert('shell', 'curl', {
2031
indent: false

0 commit comments

Comments
 (0)