Skip to content

Commit

Permalink
Using expect() elsewhere too
Browse files Browse the repository at this point in the history
  • Loading branch information
carhartl committed Jan 25, 2013
1 parent 8e2adc4 commit a464b55
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ test('raw: true', function () {
equal($.cookie('c', ' v').split('=')[1], ' v', 'should not encode');
});

test('json: true', 1, function () {
test('json: true', function () {
expect(1);
$.cookie.json = true;

if ('JSON' in window) {
Expand All @@ -191,7 +192,8 @@ test('json: true', 1, function () {

module('delete', before);

test('delete (deprecated)', 1, function () {
test('delete (deprecated)', function () {
expect(1);
document.cookie = 'c=v';
$.cookie('c', null);
equal(document.cookie, '', 'should delete the cookie');
Expand All @@ -200,20 +202,23 @@ test('delete (deprecated)', 1, function () {

module('removeCookie', before);

test('delete', 1, function() {
test('delete', function() {
expect(1);
document.cookie = 'c=v';
$.removeCookie('c');
equal(document.cookie, '', 'should delete the cookie');
});

test('return', 2, function() {
test('return', function() {
expect(2);
equal($.removeCookie('c'), false, "should return false if a cookie wasn't found");

document.cookie = 'c=v';
equal($.removeCookie('c'), true, 'should return true if the cookie was found');
});

test('with options', 2, function() {
test('with options', function() {
expect(2);
var oldCookie = $.cookie;

$.cookie = function(arg0, arg1, arg2) {
Expand Down

0 comments on commit a464b55

Please sign in to comment.