diff options
| author | Vojta Jina | 2012-01-02 20:50:17 -0800 |
|---|---|---|
| committer | Vojta Jina | 2012-01-03 15:09:00 -0800 |
| commit | c594f75b4c59a5341741f012a4f2942a920bac8c (patch) | |
| tree | 74d2c0a366edf6b970f6e93bc9d6de346106a676 /test/JsonSpec.js | |
| parent | 50eb7f15b8b9bfbf7b1aed193ce72ec9b586dc14 (diff) | |
| download | angular.js-c594f75b4c59a5341741f012a4f2942a920bac8c.tar.bz2 | |
refactor: remove old JSTD assertions
So that we can run the tests even without JSTD :-D
Diffstat (limited to 'test/JsonSpec.js')
| -rw-r--r-- | test/JsonSpec.js | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/test/JsonSpec.js b/test/JsonSpec.js index 736e6032..3329c223 100644 --- a/test/JsonSpec.js +++ b/test/JsonSpec.js @@ -219,14 +219,14 @@ describe('json', function() { }); - + it('should read/write to date', function() { var date = new Date("Sep 10 2003 13:02:03 GMT"); - assertEquals("2003-09-10T13:02:03.000Z", jsonDateToString(date)); - assertEquals(date.getTime(), jsonStringToDate(jsonDateToString(date)).getTime()); + expect(jsonDateToString(date)).toBe("2003-09-10T13:02:03.000Z"); + expect(jsonStringToDate(jsonDateToString(date)).getTime()).toBe(date.getTime()); }); - - + + it('should convert to date', function() { //full ISO8061 expect(jsonStringToDate("2003-09-10T13:02:03.000Z")). @@ -249,31 +249,31 @@ describe('json', function() { toEqual(new Date("Sep 10 2003 00:00:00 GMT")); }); - + it('should parse date', function() { var date = jsonStringToDate("2003-09-10T13:02:03.000Z"); - assertEquals("2003-09-10T13:02:03.000Z", jsonDateToString(date)); - assertEquals("str", jsonStringToDate("str")); + expect(jsonDateToString(date)).toBe("2003-09-10T13:02:03.000Z"); + expect(jsonStringToDate("str")).toBe("str"); }); describe('string', function() { it('should quote', function() { - assertEquals(quoteUnicode('a'), '"a"'); - assertEquals(quoteUnicode('\\'), '"\\\\"'); - assertEquals(quoteUnicode("'a'"), '"\'a\'"'); - assertEquals(quoteUnicode('"a"'), '"\\"a\\""'); - assertEquals(quoteUnicode('\n\f\r\t'), '"\\n\\f\\r\\t"'); + expect(quoteUnicode('a')).toBe('"a"'); + expect(quoteUnicode('\\')).toBe('"\\\\"'); + expect(quoteUnicode("'a'")).toBe('"\'a\'"'); + expect(quoteUnicode('"a"')).toBe('"\\"a\\""'); + expect(quoteUnicode('\n\f\r\t')).toBe('"\\n\\f\\r\\t"'); }); it('should quote slashes', function() { - assertEquals('"7\\\\\\\"7"', quoteUnicode("7\\\"7")); + expect(quoteUnicode("7\\\"7")).toBe('"7\\\\\\\"7"'); }); it('should quote unicode', function() { - assertEquals('"abc\\u00a0def"', quoteUnicode('abc\u00A0def')); + expect(quoteUnicode('abc\u00A0def')).toBe('"abc\\u00a0def"'); }); }); - + }); |
