Added missing 'source' getter on Spec02

Signed-off-by: Michele Angioni <michele.angioni@takeaway.com>
This commit is contained in:
Michele Angioni 2019-03-06 16:36:00 +01:00
parent 2cc5999704
commit 41710130f1
3 changed files with 33 additions and 3 deletions

View File

@ -59,6 +59,10 @@ Spec02.prototype.source = function(_source){
return this;
};
Spec02.prototype.getSource = function() {
return this.payload["source"];
};
Spec02.prototype.id = function(_id){
this.payload["id"] = _id;
return this;

View File

@ -15,6 +15,19 @@ var cloudevent = new Cloudevent()
describe("CloudEvents Spec 0.1 - JavaScript SDK", () => {
describe("Object properties", () => {
describe("Attribute getters", () => {
it("returns 'type'", () => {
expect(cloudevent.getType()).to.equal(type);
});
it("returns 'source'", () => {
expect(cloudevent.getSource()).to.equal(source);
});
});
});
describe("JSON Format", () => {
describe("Required context attributes", () => {

View File

@ -16,6 +16,19 @@ var cloudevent =
describe("CloudEvents Spec 0.2 - JavaScript SDK", () => {
describe("Object properties", () => {
describe("Attribute getters", () => {
it("returns 'type'", () => {
expect(cloudevent.getType()).to.equal(type);
});
it("returns 'source'", () => {
expect(cloudevent.getSource()).to.equal(source);
});
});
});
describe("JSON Format", () => {
describe("Required context attributes", () => {