jasmine.log() and Spec#log() take multiple arguments which are pretty-printed and concatted together.

Log messages are handled correctly in TrivialReporter and JsApiReporter.
This commit is contained in:
Lee Byrd & Christian Williams
2010-06-22 12:23:54 -07:00
parent 3bdc96c00a
commit e7cd6a473a
11 changed files with 124 additions and 55 deletions

15
spec/suites/BaseSpec.js Normal file
View File

@@ -0,0 +1,15 @@
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!");
});
});
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).wasCalledWith(1, 2, 3);
});
});