From a8e171f1ad23ae7d8074e1df9513ff559d33128c Mon Sep 17 00:00:00 2001 From: Anthony Allan Date: Wed, 16 Mar 2016 11:41:01 -0500 Subject: [PATCH] Add test for curl binary opt --- test/targets/shell/curl.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/targets/shell/curl.js b/test/targets/shell/curl.js index 9066ad87d..2206a6e3d 100644 --- a/test/targets/shell/curl.js +++ b/test/targets/shell/curl.js @@ -15,6 +15,17 @@ module.exports = function (HTTPSnippet, fixtures) { 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") }) + it('should use binary option', function () { + var result = new HTTPSnippet(fixtures.requests.full).convert('shell', 'curl', { + short: true, + indent: false, + binary: true + }) + + result.should.be.a.String + 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") + }) + it('should use --http1.0 for HTTP/1.0', function () { var result = new HTTPSnippet(fixtures.curl.http1).convert('shell', 'curl', { indent: false