spec/js/utilities.spec.js in twitter_cldr_js-2.4.0 vs spec/js/utilities.spec.js in twitter_cldr_js-3.1.0
- old
+ new
@@ -1,9 +1,11 @@
// Copyright 2012 Twitter, Inc
// http://www.apache.org/licenses/LICENSE-2.0
-var TwitterCldr = require('../../lib/assets/javascripts/twitter_cldr/en.js');
+var TwitterCldr = require('../../lib/assets/javascripts/twitter_cldr/core.js');
+var data = require('../../lib/assets/javascripts/twitter_cldr/en.js');
+TwitterCldr.set_data(data);
describe("Utilities", function() {
describe("#remove_duplicates", function() {
it("should remove duplicates elements from the array", function() {
expect(TwitterCldr.Utilities.remove_duplicates([1,2,3,4,1,5])).toEqual([1,2,3,4,5]);
@@ -33,23 +35,23 @@
var obj = {a : "b", c : "d"};
var clone = TwitterCldr.Utilities.clone(obj);
expect(clone).toEqual(obj);
expect(clone).not.toBe(obj);
expect(clone["a"]).toEqual(obj["a"]);
- expect(clone["c"]).toEqual(obj["c"]);
+ expect(clone["c"]).toEqual(obj["c"]);
});
});
describe("#compute_cache_key", function() {
it("creates a cache key for an array of pieces", function() {
- expect(TwitterCldr.Utilities.compute_cache_key(["a", "b"])).toEqual("a|b");
+ expect(TwitterCldr.Utilities.compute_cache_key(["a", "b"])).toEqual("a|b");
});
it("returns null for empty arrays", function() {
- expect(TwitterCldr.Utilities.compute_cache_key([])).toBe(null);
+ expect(TwitterCldr.Utilities.compute_cache_key([])).toBe(null);
});
it("returns null if no parameters are passed", function() {
- expect(TwitterCldr.Utilities.compute_cache_key()).toBe(null);
+ expect(TwitterCldr.Utilities.compute_cache_key()).toBe(null);
});
});
describe("#is_even", function() {
it("should return true if the given number is even", function() {
@@ -159,6 +161,6 @@
var str = TwitterCldr.Utilities.pack_array([0x2F804, 0x1F3E9]);
expect(TwitterCldr.Utilities.char_code_at(str, 0)).toEqual(194564);
expect(TwitterCldr.Utilities.char_code_at(str, 1)).toEqual(127977);
});
});
-});
\ No newline at end of file
+});