Skip to content

Commit

Permalink
Added test and CI stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
bjornharrtell committed Jul 10, 2012
1 parent 29236a8 commit 0ec50c5
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .travis.yml
@@ -0,0 +1,5 @@
language: node_js
node_js:
- 0.4
- 0.6
- 0.8
6 changes: 5 additions & 1 deletion package.json
Expand Up @@ -6,6 +6,9 @@
"homepage": "https://github.com/bjornharrtell/postgresql-http-server",
"bin": "bin/postgresql-http-server",
"main": "lib/cli.coffee",
"scripts": {
"test": "jasmine-node --matchall --coffee test"
},
"preferGlobal": "true",
"repository": {
"type": "git",
Expand All @@ -22,7 +25,8 @@
"optimist": "0.3.4",
"express": "2.5.11",
"pg": "0.7.2",
"log": "1.3.0"
"log": "1.3.0",
"jasmine-node": "1.0.26"
},
"license": "MIT"
}
33 changes: 33 additions & 0 deletions test/resources/root.coffee
@@ -0,0 +1,33 @@
root = require '../../lib/resources/root'

mockedServer =
log:
debug: ->
app:
get: (path, callback) ->
mockedServer.callback = callback
db:
query: (options) ->
options.callback
rows: [
character_value: "09.01.0004"
]


describe 'root', ->
it 'should answer a GET request with an object created from db instance info', ->
root mockedServer

req =
params:
databaseName: 'test'
res =
send: (json) ->
expect(json).toEqual
version : null
version_human : '09.01.0004'
description : 'PostgreSQL 09.01.0004'
children : [ 'db' ]

mockedServer.callback req, res

0 comments on commit 0ec50c5

Please sign in to comment.