Sha256: 7c5a3560b36022784c40d68f1bdafb3d9827281253a074f48ed08dd6507746e9

Contents?: true

Size: 867 Bytes

Versions: 2

Compression:

Stored size: 867 Bytes

Contents

var I18n = require("../../app/assets/javascripts/i18n")
  , Translations = require("./translations")
;

describe("Extend", function () {
  it("should return an object", function () {
    expect(typeof I18n.extend()).toBe('object');
  });

  it("should merge 2 objects into 1", function () {
    var obj1 = {
      test1: "abc"
    }
    , obj2 = {
      test2: "xyz"
    }
    , expected = {
      test1: "abc"
      , test2: "xyz"
    };

    expect(I18n.extend(obj1,obj2)).toEqual(expected);
  });
  it("should overwrite a property from obj1 with the same property of obj2", function () {
    var obj1 = {
      test1: "abc"
      , test3: "def"
    }
    , obj2 = {
      test2: "xyz"
      , test3: "uvw"
    }
    , expected = {
      test1: "abc"
      , test2: "xyz"
      , test3: "uvw"
    };

    expect(I18n.extend(obj1,obj2)).toEqual(expected);
  });
});

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
i18n-js-3.0.0.rc13 spec/js/extend.spec.js
i18n-js-3.0.0.rc12 spec/js/extend.spec.js