dwf/rva - moved should_be_defined() into Jasmine from Tweed

This commit is contained in:
pivotal
2009-01-07 17:12:17 -08:00
parent d9345b3874
commit 183b06bb9d
3 changed files with 70 additions and 57 deletions

14
test/bootstrap.js vendored
View File

@@ -58,13 +58,21 @@ var testMatchersComparisons = function () {
reporter.test(!(expected.should_not_equal(true)),
'expects_that(true).should_not_equal(false) retruned true');
expected = new Jasmine.Matchers('foobarbel');
expected = new Jasmine.Matchers('foobarbel');
reporter.test((expected.should_match(/bar/)),
'expects_that(forbarbel).should_match(/bar/) returned false');
expected = new Jasmine.Matchers('foobazbel');
reporter.test(!(expected.should_match(/bar/)),
'expects_that(forbazbel).should_match(/bar/) returned true');
expected = new Jasmine.Matchers('foo');
reporter.test(expected.should_be_defined(),
'expects_that(foo).should_be_defined() returned true');
expected = new Jasmine.Matchers(undefined);
reporter.test(! expected.should_be_defined(),
'expects_that(undefined).should_be_defined() returned false');
}
var testMatchersReporting = function () {
@@ -826,13 +834,13 @@ var testHandlesExceptions = function () {
reporter.test((runner.suites[0].specs[0].expectationResults[0].passed === false),
'First test should have failed, got passed');
reporter.test((runner.suites[0].specs[0].expectationResults[0].message === 'ReferenceError: fakeObject is not defined in file:///Users/pivotal/workspace/jasmine/test/bootstrap.js (line 799)'),
reporter.test((runner.suites[0].specs[0].expectationResults[0].message === 'ReferenceError: fakeObject is not defined in file:///Users/pivotal/workspace/jasmine/test/bootstrap.js (line 807)'),
'First test should have shown some exception string, got ' + runner.suites[0].specs[0].expectationResults[0].message);
reporter.test((runner.suites[0].specs[1].expectationResults[0].passed === false),
'Second test should have a failing first result, got passed');
reporter.test((runner.suites[0].specs[1].expectationResults[0].message === 'ReferenceError: fakeObject2 is not defined in file:///Users/pivotal/workspace/jasmine/test/bootstrap.js (line 805)'),
reporter.test((runner.suites[0].specs[1].expectationResults[0].message === 'ReferenceError: fakeObject2 is not defined in file:///Users/pivotal/workspace/jasmine/test/bootstrap.js (line 813)'),
'Second test should have shown an exception message for the first result, got ' + runner.suites[0].specs[1].expectationResults[0].message);
reporter.test((runner.suites[0].specs[1].expectationResults[1].passed === true),