jasmine/spec/suites/BaseSpec.js

28 lines
914 B
JavaScript
Raw Normal View History

2010-06-22 23:45:35 +00:00
describe("base.js", function() {
describe("jasmine.MessageResult", function() {
it("#toString should pretty-print and concatenate each part of the message", function() {
var values = ["log", "message", 123, {key: "value"}, "FTW!"];
var messageResult = new jasmine.MessageResult(values);
expect(messageResult.toString()).toEqual("log message 123 { key : 'value' } FTW!");
});
});
2010-06-22 23:45:35 +00:00
describe("jasmine.log", function() {
it("should accept n arguments", function() {
spyOn(jasmine.getEnv().currentSpec, 'log');
jasmine.log(1, 2, 3);
expect(jasmine.getEnv().currentSpec.log).toHaveBeenCalledWith(1, 2, 3);
2010-06-22 23:45:35 +00:00
});
});
2010-06-22 23:45:35 +00:00
describe("jasmine.getGlobal", function() {
it("should return the global object", function() {
var globalObject = (function() {
return this;
})();
2010-06-22 23:45:35 +00:00
expect(jasmine.getGlobal()).toBe(globalObject);
});
});
2010-06-22 23:45:35 +00:00
});