var should = require('should'),
stringify = require('../lib/querystring').build;
describe('stringify', function() {
describe('with null', function() {
it('throws', function() {
(function() {
var res = stringify(null);
}).should.throw();
})
})
describe('with a number', function() {
it('throws', function() {
(function() {
var res = stringify(100);
}).should.throw();
})
})
describe('with a string', function() {
describe('that is empty', function() {
it('throws', function() {
(function() {
var res = stringify('');
}).should.throw();
})
})
describe('that doesnt contain an equal sign', function() {
it('throws', function() {
(function() {
var res = stringify('boomshagalaga');
}).should.throw();
})
})
describe('that contains an equal sign', function() {
it('works', function() {
var res = stringify('hello=123');