Skip to content

Commit

Permalink
Updated tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Wesselhoeft committed Mar 11, 2013
1 parent 3d031f6 commit 2708d7f
Show file tree
Hide file tree
Showing 15 changed files with 643 additions and 556 deletions.
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -11,8 +11,8 @@
}
, "dependencies": { "request": "~2" }
, "devDependencies":
{ "jshint": ">= 1"
, "tap": ">= 0.4"
{ "jshint": "~1"
, "tap": "~0.4"
}
, "scripts": { "test": "make test" }
, "license": "MIT"
Expand Down
56 changes: 0 additions & 56 deletions tests/arena.test.js

This file was deleted.

91 changes: 0 additions & 91 deletions tests/auction.test.js

This file was deleted.

79 changes: 79 additions & 0 deletions tests/battlepet.test.js
@@ -0,0 +1,79 @@
var test = require('tap').test
, armory = require('../')

var Stream = require('stream').Stream

test('battlePetAbility', function(t) {
var options = { id: 222, region: 'us' }

t.test('should build correct url and response', function(t) {
armory.battlePetAbility(options, function(err, body, res) {
t.notOk(err, 'no error returned')
t.equal(res.req.path, '/api/wow/battlePet/ability/222', 'built api url')
t.equal(res.statusCode, 200, 'returned 200')
t.type(body, 'object', 'returned an object')
t.end()
})
})

t.test('should return a Stream if no callback is passed', function(t) {
var res = armory.battlePetAbility(options)

t.type(res, Stream)
t.end()
})
})

test('battlePetSpecies', function(t) {
var options = { id: 444, region: 'us' }

t.test('should build correct url and response', function(t) {
armory.battlePetSpecies(options, function(err, body, res) {
t.notOk(err, 'no error returned')
t.equal(res.req.path, '/api/wow/battlePet/species/444', 'built api url')
t.equal(res.statusCode, 200, 'returned 200')
t.type(body, 'object', 'returned an object')
t.end()
})
})

t.test('should return a Stream if no callback is passed', function(t) {
var res = armory.battlePetSpecies(options)

t.type(res, Stream)
t.end()
})
})

test('battlePetStats', function(t) {
var options =
{ id: 258
, breedId: 5
, level: 25
, qualityId: 4
, region: 'us'
}

t.test('should build correct url and response', function(t) {
armory.battlePetStats(options, function(err, body, res) {
t.notOk(err, 'no error returned')

t.similar(
res.req.path
, '/api/wow/battlePet/stats/258?breedId=5&level=25&qualityId=4'
, 'built api url'
)

t.equal(res.statusCode, 200, 'returned 200')
t.type(body, 'object', 'returned an object')
t.end()
})
})

t.test('should return a Stream if no callback is passed', function(t) {
var res = armory.battlePetStats(options)

t.type(res, Stream)
t.end()
})
})
85 changes: 0 additions & 85 deletions tests/character.test.js

This file was deleted.

0 comments on commit 2708d7f

Please sign in to comment.