Merge pull request #8 from micheleangioni/source-getter

Added missing 'source' getter on Spec02
This commit is contained in:
Fabio José 2019-04-18 16:11:07 -03:00 committed by GitHub
commit 7bf109ae38
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 33 additions and 7 deletions

View File

@ -25,7 +25,3 @@ jobs:
skip_cleanup: true
on:
tags: true
env:
global:
secure: t0A5/Fk1Qj8WkAk0ZuQqpFjrpINV6gfL+d1fXgq03EOAG/7FEyyz+AKkYaLT6avp26VWBzLgEoWC3RNmWD0v1/Ruckb95YpQcb5e4JotAce1ZsHgGTgx0UO146tkyGvXBw6MmO2nX2O/sHzkmyR6rlKkBi9LEKokJ9OFd6fi9nNtksgUDxkqNlNTu100fIQAV2RcN47C6iUx+gJIa+H/8QX/Cz02MyheXLe8a763wMQapz5GHrk2KuVY6FpylcAlSi2so+PjEGfKq3MWaQnTPkevkRDLtGcecVtFAq/0VbvoKc97PHoVT0x+nf48k1gj2VnQtYj6EVB74yRvqM9KkNOsfAQ0z9zF5wXMRs11SZywSViLQsnD9Ue6eYbYmodOKn4DFlLtoRyLBUspzLuoL76lERGe2cHU+Ebz2Nb9jL88o+SjfGrSJQEJU7SLZLbzJ7T/3SspWcAlo+Fo9UTCOB4/yL22Yge/SWQkdd1orBhohpjpyrU9Z1+IRvVoU1EICr04zSFUwEwn6Yxbt0ArgTZBEf11bf+YpCo+rBXNAd+XbZ79PGOEppFb+Hxrt9i1S1RnesDJnwC0k7cswU55Rv5gcNCo9lC+N4ZwS5y+5r6DsBfB+12YdsFORFyNbClECro1ODv4STf3rBBnjL8+ziPFjP4d4OwiGY+vG8bvLXY=
script: npm run coverage

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", () => {