Files
jasmine/spec/core/UtilSpec.js
Dan Hansen and Davis W. Frank cf7bb0269b Added grunt to project.
Move from embedded "fork" of jsHint to using grunt's jsHint module.
Cleaned ALL jsHint errors.
Added jasmine.util.isUndefined as alternative to extra careful protection against undefined clobbering
2013-03-01 14:28:18 -08:00

29 lines
1001 B
JavaScript

describe("jasmine.util", function() {
describe("isArray_", function() {
it("should return true if the argument is an array", function() {
expect(jasmine.isArray_([])).toBe(true);
expect(jasmine.isArray_(['a'])).toBe(true);
});
it("should return false if the argument is not an array", function() {
expect(jasmine.isArray_(undefined)).toBe(false);
expect(jasmine.isArray_({})).toBe(false);
expect(jasmine.isArray_(function() {})).toBe(false);
expect(jasmine.isArray_('foo')).toBe(false);
expect(jasmine.isArray_(5)).toBe(false);
expect(jasmine.isArray_(null)).toBe(false);
});
});
describe("isUndefined", function() {
it("reports if a variable is defined", function() {
var a;
expect(jasmine.util.isUndefined(a)).toBe(true);
expect(jasmine.util.isUndefined(undefined)).toBe(true);
var undefined = "diz be undefined yo";
expect(jasmine.util.isUndefined(undefined)).toBe(false);
});
});
});