Permalink
Browse files

BinaryCarrier does not fulfill the API contract for binary carrier ob…

…jects (#60)
  • Loading branch information...
1 parent c6cd96e commit b6d84fe87fd5999c43f3643bd00065d3fd077377 @bripkens bripkens committed with bensigelman Nov 27, 2016
View
@@ -6,7 +6,7 @@ History
0.13.1 (unreleased)
-------------------
-- No changes yet
+- `BinaryCarrier` now fulfills the API contract that binary carrier objects have a `buffer` property.
0.13.0 (2016-10-14)
@@ -15,7 +15,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
var BinaryCarrier = function BinaryCarrier(binaryData) {
_classCallCheck(this, BinaryCarrier);
- this._buffer = binaryData;
+ this.buffer = binaryData;
};
exports.default = BinaryCarrier;
@@ -1 +1 @@
-{"version":3,"sources":["../src/binary_carrier.js"],"names":[],"mappings":";;;;;;;;AAAA;;;;;;IAMqB,a,GACjB,uBAAY,UAAZ,EAAwB;AAAA;;AACpB,SAAK,OAAL,GAAe,UAAf;AACH,C;;kBAHgB,a","file":"binary_carrier.js","sourcesContent":["/**\n * Convenience class to use as a binary carrier.\n *\n * Any valid Object with a field named `buffer` may be used as a binary carrier;\n * this class is only one such type of object that can be used.\n */\nexport default class BinaryCarrier {\n constructor(binaryData) {\n this._buffer = binaryData;\n }\n}\n"]}
+{"version":3,"sources":["../src/binary_carrier.js"],"names":[],"mappings":";;;;;;;;AAAA;;;;;;IAMqB,a,GACjB,uBAAY,UAAZ,EAAwB;AAAA;;AACpB,SAAK,MAAL,GAAc,UAAd;AACH,C;;kBAHgB,a","file":"binary_carrier.js","sourcesContent":["/**\n * Convenience class to use as a binary carrier.\n *\n * Any valid Object with a field named `buffer` may be used as a binary carrier;\n * this class is only one such type of object that can be used.\n */\nexport default class BinaryCarrier {\n constructor(binaryData) {\n this.buffer = binaryData;\n }\n}\n"]}
@@ -15,7 +15,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
var BinaryCarrier = function BinaryCarrier(binaryData) {
_classCallCheck(this, BinaryCarrier);
- this._buffer = binaryData;
+ this.buffer = binaryData;
};
exports.default = BinaryCarrier;
@@ -1 +1 @@
-{"version":3,"sources":["../src/binary_carrier.js"],"names":[],"mappings":";;;;;;;;AAAA;;;;;;IAMqB,a,GACjB,uBAAY,UAAZ,EAAwB;AAAA;;AACpB,SAAK,OAAL,GAAe,UAAf;AACH,C;;kBAHgB,a","file":"binary_carrier.js","sourcesContent":["/**\n * Convenience class to use as a binary carrier.\n *\n * Any valid Object with a field named `buffer` may be used as a binary carrier;\n * this class is only one such type of object that can be used.\n */\nexport default class BinaryCarrier {\n constructor(binaryData) {\n this._buffer = binaryData;\n }\n}\n"]}
+{"version":3,"sources":["../src/binary_carrier.js"],"names":[],"mappings":";;;;;;;;AAAA;;;;;;IAMqB,a,GACjB,uBAAY,UAAZ,EAAwB;AAAA;;AACpB,SAAK,MAAL,GAAc,UAAd;AACH,C;;kBAHgB,a","file":"binary_carrier.js","sourcesContent":["/**\n * Convenience class to use as a binary carrier.\n *\n * Any valid Object with a field named `buffer` may be used as a binary carrier;\n * this class is only one such type of object that can be used.\n */\nexport default class BinaryCarrier {\n constructor(binaryData) {\n this.buffer = binaryData;\n }\n}\n"]}
@@ -6,6 +6,6 @@
*/
export default class BinaryCarrier {
constructor(binaryData) {
- this._buffer = binaryData;
+ this.buffer = binaryData;
}
}
@@ -66,5 +66,14 @@ module.exports = function opentracingAPITests() {
expect(ref).to.be.an('object');
});
});
+
+
+ describe('BinaryCarrier', function() {
+ it('should set binary data as a field called "buffer"', function() {
+ var buffer = new Float64Array();
+ var ref = new opentracing.BinaryCarrier(buffer);
+ expect(ref.buffer).to.equal(buffer);
+ });
+ });
});
}

0 comments on commit b6d84fe

Please sign in to comment.