Remove jasmine.util.extend
This commit is contained in:
@@ -124,15 +124,15 @@ describe("ConsoleReporter", function() {
|
||||
});
|
||||
|
||||
it("prints the proper output under a failure scenario.", function() {
|
||||
var base1 = jasmine.util.extend({}, failingSpec),
|
||||
failingSpec1 = jasmine.util.extend(base1, {
|
||||
var base1 = extend({}, failingSpec),
|
||||
failingSpec1 = extend(base1, {
|
||||
fullName: 'The oven heats up',
|
||||
failedExpectations: [
|
||||
{trace:{stack:"stack trace one\n second line"}},
|
||||
{trace:{stack:"stack trace two"}}
|
||||
]}),
|
||||
base2 = jasmine.util.extend({}, failingSpec),
|
||||
failingSpec2 = jasmine.util.extend(base2, {
|
||||
base2 = extend({}, failingSpec),
|
||||
failingSpec2 = extend(base2, {
|
||||
fullName: "The washing machine washes clothes",
|
||||
failedExpectations: [
|
||||
{trace:{stack:"stack trace one"}}
|
||||
@@ -284,4 +284,9 @@ describe("ConsoleReporter", function() {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
function extend(destination, source) {
|
||||
for (var property in source) destination[property] = source[property];
|
||||
return destination;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,26 +1,4 @@
|
||||
describe("jasmine.util", function() {
|
||||
describe("extend", function () {
|
||||
it("should add properies to a destination object ", function() {
|
||||
var destination = {baz: 'baz'};
|
||||
jasmine.util.extend(destination, {
|
||||
foo: 'foo', bar: 'bar'
|
||||
});
|
||||
expect(destination).toEqual({foo: 'foo', bar: 'bar', baz: 'baz'});
|
||||
});
|
||||
|
||||
it("should replace properies that already exist on a destination object", function() {
|
||||
var destination = {foo: 'foo'};
|
||||
jasmine.util.extend(destination, {
|
||||
foo: 'bar'
|
||||
});
|
||||
expect(destination).toEqual({foo: 'bar'});
|
||||
jasmine.util.extend(destination, {
|
||||
foo: null
|
||||
});
|
||||
expect(destination).toEqual({foo: null});
|
||||
});
|
||||
});
|
||||
|
||||
describe("isArray_", function() {
|
||||
it("should return true if the argument is an array", function() {
|
||||
expect(jasmine.isArray_([])).toBe(true);
|
||||
|
||||
@@ -1,5 +1,2 @@
|
||||
var originalJasmine = jasmine;
|
||||
//copy clock methods back into window,
|
||||
//so second jasmine load doesn't use jasmine clock methods.
|
||||
jasmine.util.extend(window, jasmine.Clock.real);
|
||||
jasmine = null;
|
||||
|
||||
Reference in New Issue
Block a user