diff --git a/friday-participants.json b/friday-participants.json new file mode 100644 index 0000000..cbad536 --- /dev/null +++ b/friday-participants.json @@ -0,0 +1,32 @@ +[ + "joaquimserafim", + "nunoveloso", + "satazor", + "johnbrett", + "andrefs", + "davecocoa", + "pedrocarrico", + "paulovieira", + "taterbase", + "filipediasferreira", + "KidkArolis", + "dymonaz", + "marcooliveira", + "rjsmelo", + "miguelampereira", + "zkiiito", + "balazsgabor", + "hugomota", + "pvhee", + "marcelombc", + "jamgomes", + "baldasman", + "antoniocapelo", + "ana-rodrigues", + "suprememoocow", + "davidfoliveira", + "pmarques", + "gergelyke", + "anarcastanho", + "trenpixster" +] \ No newline at end of file diff --git a/lib/plugins/trenpixster/index.js b/lib/plugins/trenpixster/index.js new file mode 100644 index 0000000..3dd2de9 --- /dev/null +++ b/lib/plugins/trenpixster/index.js @@ -0,0 +1,25 @@ +'use strict'; + +// Declare internals +var internals = {}; + +// Defaults +internals.defaults = {}; + +exports.register = function(plugin, options, next) { + + plugin.route({ + method: 'GET', + path: '/trenpixster', + handler: function(request, reply) { + reply('don\'t worry, be hapi!'); + } + }); + + next(); +}; + +exports.register.attributes = { + name: 'trenpixster', + version: '0.0.0' +}; diff --git a/participants.js b/participants.js index 9b965c4..ee973a3 100644 --- a/participants.js +++ b/participants.js @@ -1,5 +1,5 @@ var fs = require('fs'); -var participants = [ +var participants = [ 'joaquimserafim', 'nunoveloso', 'satazor', @@ -56,7 +56,8 @@ var participants = [ 'catarinamoura', 'yrezgui', 'pmiguelrn', - 'nihildacta' + 'nihildacta', + 'trenpixster' ]; // var saturday = [ diff --git a/participants.json b/participants.json index 818862a..59b7c03 100644 --- a/participants.json +++ b/participants.json @@ -1,4 +1,4 @@ -[ +[ "joaquimserafim", "nunoveloso", "satazor", @@ -55,5 +55,6 @@ "catarinamoura", "yrezgui", "pmiguelrn", - "nihildacta" + "nihildacta", + "trenpixster" ] \ No newline at end of file diff --git a/test/plugins/trenpixster/index.js b/test/plugins/trenpixster/index.js new file mode 100644 index 0000000..645a59d --- /dev/null +++ b/test/plugins/trenpixster/index.js @@ -0,0 +1,51 @@ +'use strict'; + +var Lab = require('lab'), + Hapi = require('hapi'), + Plugin = require('../../../lib/plugins/trenpixster'); + +var describe = Lab.experiment; +var it = Lab.test; +var expect = Lab.expect; +var before = Lab.before; +var after = Lab.after; + +describe('trenpixster', function() { + var server = new Hapi.Server(); + it('Plugin successfully loads', function(done) { + server.pack.register(Plugin, function(err) { + + expect(err).to.not.exist; + + done(); + }); + }); + + it('Plugin registers routes', function(done) { + var table = server.table(); + + expect(table).to.have.length(1); + expect(table[0].path).to.equal('/trenpixster'); + + done(); + }); + + it('Plugin route responses', function(done) { + var table = server.table(); + + expect(table).to.have.length(1); + expect(table[0].path).to.equal('/trenpixster'); + + var request = { + method: 'GET', + url: '/trenpixster' + }; + + server.inject(request, function(res) { + expect(res.statusCode).to.equal(200); + expect(res.result).to.equal('don\'t worry, be hapi!'); + done(); + }); + + }); +});