unexpected-messy
Advanced tools
@@ -344,3 +344,3 @@ var messy = require('messy'), | ||
| if (d) { | ||
| output.nl().indentLines().append(d).outdentLines; | ||
| output.nl().append(d); | ||
| } | ||
@@ -882,2 +882,3 @@ } else { | ||
| var requestLineSpec = _.pick(value, messy.RequestLine.propertyNames); | ||
| delete messageValue.encrypted; | ||
| Object.keys(requestLineSpec).forEach(function (requestLineKey) { | ||
@@ -893,2 +894,5 @@ delete messageValue[requestLineKey]; | ||
| expect(subject.requestLine, 'to [exhaustively] satisfy', requestLineSpec); | ||
| if (typeof value.encrypted !== 'undefined') { | ||
| expect(subject.encrypted, 'to satisfy', value.encrypted); | ||
| } | ||
| delete value.requestLine; | ||
@@ -925,2 +929,27 @@ } catch (e) { | ||
| } | ||
| if (typeof value.encrypted !== 'undefined') { | ||
| try { | ||
| expect(subject.encrypted, 'to satisfy', value.encrypted); | ||
| } catch (e2) { | ||
| if (e2._isUnexpected) { | ||
| if (value.encrypted === true) { | ||
| output.nl().error('// expected an encrypted request'); | ||
| } else if (value.encrypted === false) { | ||
| output.nl().error('// expected an unencrypted request'); | ||
| } else { | ||
| output.nl().annotationBlock(function () { | ||
| this.text('encrypted').sp().error(e2.label || 'should satisfy').sp().append(expect.inspect(value.encrypted)); | ||
| var d = e2.createDiff && e2.createDiff(output.clone(), diff, inspect, equal).diff; | ||
| if (d) { | ||
| this.nl().sp(2).block(d); | ||
| } | ||
| }); | ||
| } | ||
| } else { | ||
| expect.fail(e2); | ||
| } | ||
| } | ||
| } | ||
| return { | ||
@@ -927,0 +956,0 @@ diff: output |
+3
-3
| { | ||
| "name": "unexpected-messy", | ||
| "version": "2.8.0", | ||
| "version": "2.9.0", | ||
| "description": "Unexpected plugin for the messy library", | ||
@@ -42,5 +42,5 @@ "main": "lib/unexpectedMessy.js", | ||
| "jshint": "2.5.5", | ||
| "messy": "4.0.1", | ||
| "messy": "4.1.1", | ||
| "mocha": "2.0.1", | ||
| "unexpected": "5.5.2" | ||
| "unexpected": "5.8.1" | ||
| }, | ||
@@ -47,0 +47,0 @@ "dependencies": { |
Sorry, the diff of this file is too big to display
194847
2.08%2990
2.43%