test_squad 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +28 -8
- data/Rakefile +1 -0
- data/lib/generators/test_squad/install/install_generator.rb +92 -62
- data/lib/generators/test_squad/install/templates/test_squad.rb.erb +24 -1
- data/lib/tasks/test_squad_tasks.rake +7 -35
- data/lib/test_squad.rb +8 -7
- data/lib/test_squad/configuration.rb +65 -0
- data/lib/test_squad/runner.rb +58 -0
- data/lib/test_squad/version.rb +1 -1
- data/phantomjs/helpers.js +8 -1
- data/phantomjs/runner.js +39 -13
- data/test/controllers/test_squad_controller_test.rb +50 -0
- data/test/dummy/log/test.log +2161 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/--Jr18gSi0dWQfX8IpGoxIeyt0ar6Z4qNtYBzt5o_U0.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/15vEz7HBqhg9JjDp9KyF_iFJ9DOccQCaj2XecY7ENdw.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/1bShYtup0I7zDOa8whDdypfQEZxH4rVEVKmz8aeDuS0.cache +2 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/1fidLos4TsMC1Jzat66F4EuJMnvA4Ek4Yq3Wx_diqLA.cache +2 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/1p035rqBDJG2S9jFXm8UVt4XiETe3l4TsAshRjkfgJU.cache +2 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/28dNMvxD5YFKVJdljn6gcuwnJaQGlzKN1B_uJwfpWAQ.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/48aEVfcYY6MwkyeeyUtk-udKX4sVI6wCzCoGdcrXoHE.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/4oXbqlOtQXa7YIXA7S4jJT8mAZdpoSJ2oX9kXMr9Ouw.cache +3 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/5BbgAT98H6HVF2DtEaZeL3jSwsvFzHkl6-vwuQ1UoGQ.cache +3 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/5Lly_CA8DZvPhQV2jDQx-Y6P_y3Ygra9t5jfSlGhHDA.cache +2 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/6Y-2fFELXy514cZ-fXlvcoKlvvCMCHgIZ_Q06PZoMsg.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/7yaZL2RIxe_zCwIWBeGtIKMbQQcvZU1Rvt1sfZGpAcY.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/BNfX-jq9S00e7dFjTRaWBt2BNThtsO0_vKQiBGYmus8.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/BT2K9suBmG7JzM_3FoJ5mpH8wti3_Phlsl7X-8nut_A.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/BY7dYj9QBZDvgqyzjw19Cs4S7rhvgaB6Tx-3ByAfR1o.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/BkUiqZe-edco2CWEnwq71RR7OlncirMqtHSAXxRiS58.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/CI3wmSM2mvTHVtxrm8aAXPicSU_UPT54tEsOxoL8674.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/CcqHY0ztO4n-nBK-XGEP6h0DrL6x2A0G_MXIYfLdOAc.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/DOjJwX_4kbLug1vCo5qKu8WhGWrlS3CO5ueJcLwHAiw.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/Dj11DIpk6AMooko4HIrIRLle_Pku6Z3wm6JGkv6tQhY.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/Dld2HJ_h197OmHkWuEk-msUaZ5dF27-KHGDNE37nJ94.cache +4 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/DnkprrM0pXn0tWZjZQUbxw9czuz9Eqc3qXokFvQPADk.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/EvacufxhwsfPRuHbaKUtaE49aNAI6zySGzBX6QZ46fU.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/FXjOrhU0u21QlvjYFb8z9MZGZc39etPqywbESQ0wYWI.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/JlEfkGFQp4-hMkyCydaWpBH-k7TRHDnWVO4UICTABdE.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/JuyiNe16-3iPuyN77g0yLMm0Q4Yha01pWdNSfnYVfNE.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/JylXKmnNAPjfcYjj1jraIxmw8aRPbZ3LoWTzewaMHPU.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/MK8k0x0C6Wxn0o4iqysgqSy-vz5Ol5PWtsPh2uT8aRE.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/N8yUPpqki-1jUIftlMUzksb-3ImtAXdo0HK0yogXp98.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/NBnLLGZS0L0-K0XDp8wPfKEbULh0IdSnEnq5My6uLsg.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/NYqEn9nriI_u_tmIhqigPcBG-xaL_4DNAXcZZedduxo.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/NiaLRSbNa312S2yLs6OK99DsCk-OK5_WVSP5vlohbrU.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/O8AdQ9KuR_WslT3OMU_CB_XmZPkD3koya8_y3D1vQSg.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/OI6uxGcnsKavdWTtwDAasU3wPx8QXhzBgV0X2n1KjMQ.cache +2 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/OOE0vr9ZxtP3cSlMNmlKreGc5OdJjjZeAulus5KkgWg.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/SVj7Xea5NdHsDZVgKDO33zwoRmPu8dsPEPUc--ZoSBA.cache +3 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/UWG7vqp9QHDXQ8K7rWHxSLtTJjgpwAXa0VQeMC79S9c.cache +3 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/UYzP9BM42aDQbQL2Hwzu7E_VjzmKRMEDUMn_YNwYJZQ.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/V04j3gLzI35tOG8HB1FQnZC0FkgXNiVo6CFAKe-vm08.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/W90wLqYLEL21UhoMzunmDZagcl_J-waowL_syTXFTfg.cache +2 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/WRplQSvSLBRFE4SnNgUTaqjaD6QcugFgemVGJl-TcH0.cache +3 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/XZHJ4q_Vqm8z67XoLCSR9Bf3bxRrNVgxY-Zn2Dl1_oc.cache +2 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/ZpLasZgWCtI5ARba6j0TztDVBfvefbN_VeEm6WS4AlE.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/_ml2aIb-f7tzJpo9MTCAldaDVHqHn89WTB9ZmCoAVHI.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/bakkhKWQav5zpy-VjOssp_XTDY4mccVjeCQjmTWcvEQ.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/bqgbepkpHrkLsvcws1h6NEku20i6s1HNfRwUf3ds_bM.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/btifyRUVKrnuNOyCfHPRBE_b4IHXPAs-gwaNEtZNqR4.cache +2 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/eBHGAOFSIHdU3R6gC__U1b2OtNaMsdZ8M6kKd6rX3uA.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/ez1f_nTzpCVZp99l-TSKf5mnDr-FNT0AuA40By6h7nU.cache +3 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/fOMwhE_LoK6PBz43rr86imRHqStpfn-j0zKwNCEFA7A.cache +2 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/fk0Xn9aqGZauDCUL4PDM1A0riiRU3nTGEF8T0tfVi9Q.cache +3 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/g6PEU0mrTD1F_JY1UnmLjn6OD29tp6XAa7CRxtbnssU.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/k9vjsOgT-S2u8LSPksFS2VZO5JJYQB1kOSOfkmBmncA.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/kB1DR3T5YiVkiJ5JQAjwNFNLjKoCrBWbjHzmUWQxwuE.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/l-Fy5bdFTh-kc8fFcJaPEiIprPT_Zro3btmmfaOSFGk.cache +3 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/lk8cNS9qlZOFztN2ZtkUuLMG5il9UFV_6L9mzl0gJgs.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/lurwEsNalR_pkE6uX047tDOvODA4-5i3gDIrHi_4sWU.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/m4xIJn-Zz18i6rjvKkARjTE_Ogb7Y33Z1d1dkpwjIqc.cache +2 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/mwqO_5fkZLqyQ6yJZPYvfEasJmaJTDBUxg0WMRs1qb8.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/nv2dwJTpEmjPq5nrQ5gYwOUkAdhKxPmwxfhzuIGq9tc.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/o_4WHxITiPaOrX75j567d0VpQJ3ibKEfwp5kLyz0g6I.cache +2 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/pH8BdTuZBGfdsHebnGCXW4xKlDq20EJYTXXWDQ4pwF8.cache +2 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/pfueHOXdqh2SVlAKfvEFrdhOpobUofsH-rxLMv9HeAo.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/qGl34xE7nyT_5bv_0LdftjhOhWqeaUsSD8RRR5e2LhE.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/r16KTswcSzCfPAeYpPsI3pB60v7bXkXdzIC9F0depbo.cache +3 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/s1qM0DtayvbvOieVFIeEejbL_uzBbLhdJt4J-eDdfVs.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/sKmQ0vmdki8bEnqnNv5R6SxInKZ3wr6OYKZso5pK3A8.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/t3Llqx0uA6Qvi3W3tzxEvd6vCx1bNDEaOx3cv3jk7F8.cache +2 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/t4CSlKWlnNjWc4HjzVuGu_xkGPJrf2XDT_z36WqPW10.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/tTT_rRtFLpee6FOwJBDH0h8tFNayUZozM9CRDjxh_0M.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/uEbg-8OHCY_n1CRoUJ1NxO7ZA25rem-WvK_BMk9nzmA.cache +3 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/uhmMX7shFPI0NOePr7b3mCW2lOWT4osZ3sovJVlPyek.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/vRHlJJvzk-cVDuhS4H0cS0JQ4XQxPvzCLHSuDSsBABY.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/xqI5M8GTfQOT1WzlvBIaK6SBF84-BkQ162gE8xJibGY.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/y1-icrLhuhHxxsTl1oMCwvaQljaPTUg8pGKp4ktBmHk.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/yLDP63LRuXDtsRtf-U1w7iwCLO6TN0XaagOFr7ZMgJc.cache +3 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/01201a5597c67fa4700f373e24e47cc0 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/087c6a74e34024016056782770f67751 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/0e0ce4a8684bd87eafc0db448ee74990 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/0e6aec2a845fd340ec76abec275415f8 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/13096efe03b0d8f02b0f492ee46f8498 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/21822855ec5066372f2708fcc72bc18a +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/29369685706447987989cf495e746507 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/32e8c6b5f20fbc62c2c377ce3fd7d093 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/42b2a14b671c8f56aa1808a5ba8599e3 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/5254c3aa24743307528db89892e34ce7 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/54aa66a560f82535d5aff8761aa61689 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/55edadf6cfe27ddb6130791f7cb794c2 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/5b781f9fca11e70f837e07e3e9446a2d +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/60323fc3606b2c2ae59ff65886e957ef +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/63196e522f128686f2b1873406c06638 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/6d0f2dbd46d4ae67621d5544e74f789a +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/6e05ee0c7bd8a56e0aa68e9981b874c4 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/7874191c45ca716229829e331bbb6657 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/7faca529de077394ba9cccf0f936bad1 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/98ad9eb574ed821f48f81b41bcd9639f +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/991ff1c9e66557b891934a625e493439 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/9e0d5d4b56b478a2801215373bac8932 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/c95208cba67d830cebbbcb8c049d45d1 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/c9bd74b86a038dcdd4436a8dcf03041c +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/cf932323f346664ed0c3dd4af9a426f3 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/ec868f5486b890ab315724a887be51fc +0 -0
- data/test/dummy/tmp/generators/Gemfile +8 -0
- data/test/dummy/tmp/generators/test/javascript/dummy/answer_spec.js +6 -0
- data/test/dummy/tmp/generators/test/javascript/spec_helper.js +12 -0
- data/test/dummy/tmp/generators/test/javascript/test_squad.rb +28 -0
- data/test/lib/generators/test_squad/install_generator/ember_test.rb +48 -0
- data/test/lib/generators/test_squad/install_generator/jasmine_test.rb +44 -0
- data/test/lib/generators/test_squad/install_generator/mocha_test.rb +45 -0
- data/test/lib/generators/test_squad/install_generator/qunit_test.rb +44 -0
- data/test/lib/generators/test_squad/install_generator_test.rb +40 -0
- data/test/lib/test_squad/configuration_test.rb +68 -0
- data/test/lib/test_squad/runner_test.rb +66 -0
- data/test/test_helper.rb +10 -2
- data/test/test_squad_test.rb +1 -1
- data/vendor/assets/libs/jasmine/boot.js +2 -1
- data/vendor/assets/libs/jasmine/console.js +1 -1
- data/vendor/assets/libs/jasmine/jasmine-html.js +17 -5
- data/vendor/assets/libs/jasmine/jasmine.css +10 -10
- data/vendor/assets/libs/jasmine/jasmine.js +295 -155
- metadata +278 -9
- data/lib/terminal.png +0 -0
- data/test/integration/navigation_test.rb +0 -9
- data/test/lib/generators/squad/install_generator_test.rb +0 -14
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
Copyright (c) 2008-
|
2
|
+
Copyright (c) 2008-2015 Pivotal Labs
|
3
3
|
|
4
4
|
Permission is hereby granted, free of charge, to any person obtaining
|
5
5
|
a copy of this software and associated documentation files (the
|
@@ -20,13 +20,16 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
20
20
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
21
21
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
22
22
|
*/
|
23
|
-
getJasmineRequireObj = (function (jasmineGlobal) {
|
23
|
+
var getJasmineRequireObj = (function (jasmineGlobal) {
|
24
24
|
var jasmineRequire;
|
25
25
|
|
26
26
|
if (typeof module !== 'undefined' && module.exports) {
|
27
27
|
jasmineGlobal = global;
|
28
28
|
jasmineRequire = exports;
|
29
29
|
} else {
|
30
|
+
if (typeof window !== 'undefined' && typeof window.toString === 'function' && window.toString() === '[object GjsGlobal]') {
|
31
|
+
jasmineGlobal = window;
|
32
|
+
}
|
30
33
|
jasmineRequire = jasmineGlobal.jasmineRequire = jasmineGlobal.jasmineRequire || {};
|
31
34
|
}
|
32
35
|
|
@@ -40,6 +43,7 @@ getJasmineRequireObj = (function (jasmineGlobal) {
|
|
40
43
|
jRequire.base(j$, jasmineGlobal);
|
41
44
|
j$.util = jRequire.util();
|
42
45
|
j$.Any = jRequire.Any();
|
46
|
+
j$.Anything = jRequire.Anything(j$);
|
43
47
|
j$.CallTracker = jRequire.CallTracker();
|
44
48
|
j$.MockDate = jRequire.MockDate();
|
45
49
|
j$.Clock = jRequire.Clock();
|
@@ -51,12 +55,14 @@ getJasmineRequireObj = (function (jasmineGlobal) {
|
|
51
55
|
j$.JsApiReporter = jRequire.JsApiReporter();
|
52
56
|
j$.matchersUtil = jRequire.matchersUtil(j$);
|
53
57
|
j$.ObjectContaining = jRequire.ObjectContaining(j$);
|
58
|
+
j$.ArrayContaining = jRequire.ArrayContaining(j$);
|
54
59
|
j$.pp = jRequire.pp(j$);
|
55
60
|
j$.QueueRunner = jRequire.QueueRunner(j$);
|
56
61
|
j$.ReportDispatcher = jRequire.ReportDispatcher();
|
57
62
|
j$.Spec = jRequire.Spec(j$);
|
58
63
|
j$.SpyRegistry = jRequire.SpyRegistry(j$);
|
59
64
|
j$.SpyStrategy = jRequire.SpyStrategy();
|
65
|
+
j$.StringMatching = jRequire.StringMatching(j$);
|
60
66
|
j$.Suite = jRequire.Suite();
|
61
67
|
j$.Timer = jRequire.Timer();
|
62
68
|
j$.version = jRequire.version();
|
@@ -138,14 +144,30 @@ getJasmineRequireObj().base = function(j$, jasmineGlobal) {
|
|
138
144
|
return obj.nodeType > 0;
|
139
145
|
};
|
140
146
|
|
147
|
+
j$.fnNameFor = function(func) {
|
148
|
+
return func.name || func.toString().match(/^\s*function\s*(\w*)\s*\(/)[1];
|
149
|
+
};
|
150
|
+
|
141
151
|
j$.any = function(clazz) {
|
142
152
|
return new j$.Any(clazz);
|
143
153
|
};
|
144
154
|
|
155
|
+
j$.anything = function() {
|
156
|
+
return new j$.Anything();
|
157
|
+
};
|
158
|
+
|
145
159
|
j$.objectContaining = function(sample) {
|
146
160
|
return new j$.ObjectContaining(sample);
|
147
161
|
};
|
148
162
|
|
163
|
+
j$.stringMatching = function(expected) {
|
164
|
+
return new j$.StringMatching(expected);
|
165
|
+
};
|
166
|
+
|
167
|
+
j$.arrayContaining = function(sample) {
|
168
|
+
return new j$.ArrayContaining(sample);
|
169
|
+
};
|
170
|
+
|
149
171
|
j$.createSpy = function(name, originalFn) {
|
150
172
|
|
151
173
|
var spyStrategy = new j$.SpyStrategy({
|
@@ -190,6 +212,11 @@ getJasmineRequireObj().base = function(j$, jasmineGlobal) {
|
|
190
212
|
};
|
191
213
|
|
192
214
|
j$.createSpyObj = function(baseName, methodNames) {
|
215
|
+
if (j$.isArray_(baseName) && j$.util.isUndefined(methodNames)) {
|
216
|
+
methodNames = baseName;
|
217
|
+
baseName = 'unknown';
|
218
|
+
}
|
219
|
+
|
193
220
|
if (!j$.isArray_(methodNames) || methodNames.length === 0) {
|
194
221
|
throw 'createSpyObj requires a non-empty array of method names to create spies for';
|
195
222
|
}
|
@@ -285,7 +312,8 @@ getJasmineRequireObj().Spec = function(j$) {
|
|
285
312
|
description: this.description,
|
286
313
|
fullName: this.getFullName(),
|
287
314
|
failedExpectations: [],
|
288
|
-
passedExpectations: []
|
315
|
+
passedExpectations: [],
|
316
|
+
pendingReason: ''
|
289
317
|
};
|
290
318
|
}
|
291
319
|
|
@@ -334,7 +362,7 @@ getJasmineRequireObj().Spec = function(j$) {
|
|
334
362
|
|
335
363
|
Spec.prototype.onException = function onException(e) {
|
336
364
|
if (Spec.isPendingSpecException(e)) {
|
337
|
-
this.pend();
|
365
|
+
this.pend(extractCustomPendingMessage(e));
|
338
366
|
return;
|
339
367
|
}
|
340
368
|
|
@@ -351,8 +379,11 @@ getJasmineRequireObj().Spec = function(j$) {
|
|
351
379
|
this.disabled = true;
|
352
380
|
};
|
353
381
|
|
354
|
-
Spec.prototype.pend = function() {
|
382
|
+
Spec.prototype.pend = function(message) {
|
355
383
|
this.markedPending = true;
|
384
|
+
if (message) {
|
385
|
+
this.result.pendingReason = message;
|
386
|
+
}
|
356
387
|
};
|
357
388
|
|
358
389
|
Spec.prototype.status = function() {
|
@@ -379,6 +410,14 @@ getJasmineRequireObj().Spec = function(j$) {
|
|
379
410
|
return this.getSpecName(this);
|
380
411
|
};
|
381
412
|
|
413
|
+
var extractCustomPendingMessage = function(e) {
|
414
|
+
var fullMessage = e.toString(),
|
415
|
+
boilerplateStart = fullMessage.indexOf(Spec.pendingSpecExceptionMessage),
|
416
|
+
boilerplateEnd = boilerplateStart + Spec.pendingSpecExceptionMessage.length;
|
417
|
+
|
418
|
+
return fullMessage.substr(boilerplateEnd);
|
419
|
+
};
|
420
|
+
|
382
421
|
Spec.pendingSpecExceptionMessage = '=> marked Pending';
|
383
422
|
|
384
423
|
Spec.isPendingSpecException = function(e) {
|
@@ -631,11 +670,12 @@ getJasmineRequireObj().Env = function(j$) {
|
|
631
670
|
onStart: suiteStarted,
|
632
671
|
expectationFactory: expectationFactory,
|
633
672
|
expectationResultFactory: expectationResultFactory,
|
673
|
+
runnablesExplictlySetGetter: runnablesExplictlySetGetter,
|
634
674
|
resultCallback: function(attrs) {
|
635
675
|
if (!suite.disabled) {
|
636
676
|
clearResourcesForRunnable(suite.id);
|
637
|
-
currentlyExecutingSuites.pop();
|
638
677
|
}
|
678
|
+
currentlyExecutingSuites.pop();
|
639
679
|
reporter.suiteDone(attrs);
|
640
680
|
}
|
641
681
|
});
|
@@ -823,8 +863,12 @@ getJasmineRequireObj().Env = function(j$) {
|
|
823
863
|
});
|
824
864
|
};
|
825
865
|
|
826
|
-
this.pending = function() {
|
827
|
-
|
866
|
+
this.pending = function(message) {
|
867
|
+
var fullMessage = j$.Spec.pendingSpecExceptionMessage;
|
868
|
+
if(message) {
|
869
|
+
fullMessage += message;
|
870
|
+
}
|
871
|
+
throw fullMessage;
|
828
872
|
};
|
829
873
|
|
830
874
|
this.fail = function(error) {
|
@@ -839,7 +883,8 @@ getJasmineRequireObj().Env = function(j$) {
|
|
839
883
|
passed: false,
|
840
884
|
expected: '',
|
841
885
|
actual: '',
|
842
|
-
message: message
|
886
|
+
message: message,
|
887
|
+
error: error && error.message ? error : null
|
843
888
|
});
|
844
889
|
};
|
845
890
|
}
|
@@ -926,43 +971,6 @@ getJasmineRequireObj().JsApiReporter = function() {
|
|
926
971
|
return JsApiReporter;
|
927
972
|
};
|
928
973
|
|
929
|
-
getJasmineRequireObj().Any = function() {
|
930
|
-
|
931
|
-
function Any(expectedObject) {
|
932
|
-
this.expectedObject = expectedObject;
|
933
|
-
}
|
934
|
-
|
935
|
-
Any.prototype.jasmineMatches = function(other) {
|
936
|
-
if (this.expectedObject == String) {
|
937
|
-
return typeof other == 'string' || other instanceof String;
|
938
|
-
}
|
939
|
-
|
940
|
-
if (this.expectedObject == Number) {
|
941
|
-
return typeof other == 'number' || other instanceof Number;
|
942
|
-
}
|
943
|
-
|
944
|
-
if (this.expectedObject == Function) {
|
945
|
-
return typeof other == 'function' || other instanceof Function;
|
946
|
-
}
|
947
|
-
|
948
|
-
if (this.expectedObject == Object) {
|
949
|
-
return typeof other == 'object';
|
950
|
-
}
|
951
|
-
|
952
|
-
if (this.expectedObject == Boolean) {
|
953
|
-
return typeof other == 'boolean';
|
954
|
-
}
|
955
|
-
|
956
|
-
return other instanceof this.expectedObject;
|
957
|
-
};
|
958
|
-
|
959
|
-
Any.prototype.jasmineToString = function() {
|
960
|
-
return '<jasmine.any(' + this.expectedObject + ')>';
|
961
|
-
};
|
962
|
-
|
963
|
-
return Any;
|
964
|
-
};
|
965
|
-
|
966
974
|
getJasmineRequireObj().CallTracker = function() {
|
967
975
|
|
968
976
|
function CallTracker() {
|
@@ -1244,6 +1252,12 @@ getJasmineRequireObj().DelayedFunctionScheduler = function() {
|
|
1244
1252
|
scheduledFn.runAtMillis + scheduledFn.millis);
|
1245
1253
|
}
|
1246
1254
|
|
1255
|
+
function forEachFunction(funcsToRun, callback) {
|
1256
|
+
for (var i = 0; i < funcsToRun.length; ++i) {
|
1257
|
+
callback(funcsToRun[i]);
|
1258
|
+
}
|
1259
|
+
}
|
1260
|
+
|
1247
1261
|
function runScheduledFunctions(endTime) {
|
1248
1262
|
if (scheduledLookup.length === 0 || scheduledLookup[0] > endTime) {
|
1249
1263
|
return;
|
@@ -1255,15 +1269,15 @@ getJasmineRequireObj().DelayedFunctionScheduler = function() {
|
|
1255
1269
|
var funcsToRun = scheduledFunctions[currentTime];
|
1256
1270
|
delete scheduledFunctions[currentTime];
|
1257
1271
|
|
1258
|
-
|
1259
|
-
var funcToRun = funcsToRun[i];
|
1260
|
-
|
1272
|
+
forEachFunction(funcsToRun, function(funcToRun) {
|
1261
1273
|
if (funcToRun.recurring) {
|
1262
1274
|
reschedule(funcToRun);
|
1263
1275
|
}
|
1276
|
+
});
|
1264
1277
|
|
1278
|
+
forEachFunction(funcsToRun, function(funcToRun) {
|
1265
1279
|
funcToRun.funcToCall.apply(null, funcToRun.params || []);
|
1266
|
-
}
|
1280
|
+
});
|
1267
1281
|
} while (scheduledLookup.length > 0 &&
|
1268
1282
|
// checking first if we're out of time prevents setTimeout(0)
|
1269
1283
|
// scheduled in a funcToRun from forcing an extra iteration
|
@@ -1506,7 +1520,7 @@ getJasmineRequireObj().MockDate = function() {
|
|
1506
1520
|
case 6:
|
1507
1521
|
return new GlobalDate(arguments[0], arguments[1], arguments[2], arguments[3],
|
1508
1522
|
arguments[4], arguments[5]);
|
1509
|
-
|
1523
|
+
default:
|
1510
1524
|
return new GlobalDate(arguments[0], arguments[1], arguments[2], arguments[3],
|
1511
1525
|
arguments[4], arguments[5], arguments[6]);
|
1512
1526
|
}
|
@@ -1533,41 +1547,6 @@ getJasmineRequireObj().MockDate = function() {
|
|
1533
1547
|
return MockDate;
|
1534
1548
|
};
|
1535
1549
|
|
1536
|
-
getJasmineRequireObj().ObjectContaining = function(j$) {
|
1537
|
-
|
1538
|
-
function ObjectContaining(sample) {
|
1539
|
-
this.sample = sample;
|
1540
|
-
}
|
1541
|
-
|
1542
|
-
ObjectContaining.prototype.jasmineMatches = function(other, mismatchKeys, mismatchValues) {
|
1543
|
-
if (typeof(this.sample) !== 'object') { throw new Error('You must provide an object to objectContaining, not \''+this.sample+'\'.'); }
|
1544
|
-
|
1545
|
-
mismatchKeys = mismatchKeys || [];
|
1546
|
-
mismatchValues = mismatchValues || [];
|
1547
|
-
|
1548
|
-
var hasKey = function(obj, keyName) {
|
1549
|
-
return obj !== null && !j$.util.isUndefined(obj[keyName]);
|
1550
|
-
};
|
1551
|
-
|
1552
|
-
for (var property in this.sample) {
|
1553
|
-
if (!hasKey(other, property) && hasKey(this.sample, property)) {
|
1554
|
-
mismatchKeys.push('expected has key \'' + property + '\', but missing from actual.');
|
1555
|
-
}
|
1556
|
-
else if (!j$.matchersUtil.equals(other[property], this.sample[property])) {
|
1557
|
-
mismatchValues.push('\'' + property + '\' was \'' + (other[property] ? j$.util.htmlEscape(other[property].toString()) : other[property]) + '\' in actual, but was \'' + (this.sample[property] ? j$.util.htmlEscape(this.sample[property].toString()) : this.sample[property]) + '\' in expected.');
|
1558
|
-
}
|
1559
|
-
}
|
1560
|
-
|
1561
|
-
return (mismatchKeys.length === 0 && mismatchValues.length === 0);
|
1562
|
-
};
|
1563
|
-
|
1564
|
-
ObjectContaining.prototype.jasmineToString = function() {
|
1565
|
-
return '<jasmine.objectContaining(' + j$.pp(this.sample) + ')>';
|
1566
|
-
};
|
1567
|
-
|
1568
|
-
return ObjectContaining;
|
1569
|
-
};
|
1570
|
-
|
1571
1550
|
getJasmineRequireObj().pp = function(j$) {
|
1572
1551
|
|
1573
1552
|
function PrettyPrinter() {
|
@@ -1667,13 +1646,15 @@ getJasmineRequireObj().pp = function(j$) {
|
|
1667
1646
|
};
|
1668
1647
|
|
1669
1648
|
StringPrettyPrinter.prototype.emitObject = function(obj) {
|
1649
|
+
var constructorName = obj.constructor ? j$.fnNameFor(obj.constructor) : 'null';
|
1650
|
+
this.append(constructorName);
|
1651
|
+
|
1670
1652
|
if (this.ppNestLevel_ > j$.MAX_PRETTY_PRINT_DEPTH) {
|
1671
|
-
this.append('Object');
|
1672
1653
|
return;
|
1673
1654
|
}
|
1674
1655
|
|
1675
1656
|
var self = this;
|
1676
|
-
this.append('{ ');
|
1657
|
+
this.append('({ ');
|
1677
1658
|
var first = true;
|
1678
1659
|
|
1679
1660
|
this.iterateObject(obj, function(property, isGetter) {
|
@@ -1692,7 +1673,7 @@ getJasmineRequireObj().pp = function(j$) {
|
|
1692
1673
|
}
|
1693
1674
|
});
|
1694
1675
|
|
1695
|
-
this.append(' }');
|
1676
|
+
this.append(' })');
|
1696
1677
|
};
|
1697
1678
|
|
1698
1679
|
StringPrettyPrinter.prototype.append = function(value) {
|
@@ -1742,7 +1723,8 @@ getJasmineRequireObj().QueueRunner = function(j$) {
|
|
1742
1723
|
for(iterativeIndex = recursiveIndex; iterativeIndex < length; iterativeIndex++) {
|
1743
1724
|
var queueableFn = queueableFns[iterativeIndex];
|
1744
1725
|
if (queueableFn.fn.length > 0) {
|
1745
|
-
|
1726
|
+
attemptAsync(queueableFn);
|
1727
|
+
return;
|
1746
1728
|
} else {
|
1747
1729
|
attemptSync(queueableFn);
|
1748
1730
|
}
|
@@ -1857,6 +1839,10 @@ getJasmineRequireObj().SpyRegistry = function(j$) {
|
|
1857
1839
|
throw new Error('spyOn could not find an object to spy upon for ' + methodName + '()');
|
1858
1840
|
}
|
1859
1841
|
|
1842
|
+
if (j$.util.isUndefined(methodName)) {
|
1843
|
+
throw new Error('No method name supplied');
|
1844
|
+
}
|
1845
|
+
|
1860
1846
|
if (j$.util.isUndefined(obj[methodName])) {
|
1861
1847
|
throw new Error(methodName + '() method does not exist');
|
1862
1848
|
}
|
@@ -1963,6 +1949,7 @@ getJasmineRequireObj().Suite = function() {
|
|
1963
1949
|
this.clearStack = attrs.clearStack || function(fn) {fn();};
|
1964
1950
|
this.expectationFactory = attrs.expectationFactory;
|
1965
1951
|
this.expectationResultFactory = attrs.expectationResultFactory;
|
1952
|
+
this.runnablesExplictlySetGetter = attrs.runnablesExplictlySetGetter || function() {};
|
1966
1953
|
|
1967
1954
|
this.beforeFns = [];
|
1968
1955
|
this.afterFns = [];
|
@@ -2074,14 +2061,8 @@ getJasmineRequireObj().Suite = function() {
|
|
2074
2061
|
};
|
2075
2062
|
|
2076
2063
|
Suite.prototype.isExecutable = function() {
|
2077
|
-
var
|
2078
|
-
|
2079
|
-
if(this.children[i].isExecutable()) {
|
2080
|
-
foundActive = true;
|
2081
|
-
break;
|
2082
|
-
}
|
2083
|
-
}
|
2084
|
-
return foundActive;
|
2064
|
+
var runnablesExplicitlySet = this.runnablesExplictlySetGetter();
|
2065
|
+
return !runnablesExplicitlySet && hasExecutableChild(this.children);
|
2085
2066
|
};
|
2086
2067
|
|
2087
2068
|
Suite.prototype.sharedUserContext = function() {
|
@@ -2134,6 +2115,17 @@ getJasmineRequireObj().Suite = function() {
|
|
2134
2115
|
return !args[0];
|
2135
2116
|
}
|
2136
2117
|
|
2118
|
+
function hasExecutableChild(children) {
|
2119
|
+
var foundActive = false;
|
2120
|
+
for (var i = 0; i < children.length; i++) {
|
2121
|
+
if (children[i].isExecutable()) {
|
2122
|
+
foundActive = true;
|
2123
|
+
break;
|
2124
|
+
}
|
2125
|
+
}
|
2126
|
+
return foundActive;
|
2127
|
+
}
|
2128
|
+
|
2137
2129
|
function clone(obj) {
|
2138
2130
|
var clonedObj = {};
|
2139
2131
|
for (var prop in obj) {
|
@@ -2175,6 +2167,131 @@ getJasmineRequireObj().Timer = function() {
|
|
2175
2167
|
return Timer;
|
2176
2168
|
};
|
2177
2169
|
|
2170
|
+
getJasmineRequireObj().Any = function() {
|
2171
|
+
|
2172
|
+
function Any(expectedObject) {
|
2173
|
+
this.expectedObject = expectedObject;
|
2174
|
+
}
|
2175
|
+
|
2176
|
+
Any.prototype.asymmetricMatch = function(other) {
|
2177
|
+
if (this.expectedObject == String) {
|
2178
|
+
return typeof other == 'string' || other instanceof String;
|
2179
|
+
}
|
2180
|
+
|
2181
|
+
if (this.expectedObject == Number) {
|
2182
|
+
return typeof other == 'number' || other instanceof Number;
|
2183
|
+
}
|
2184
|
+
|
2185
|
+
if (this.expectedObject == Function) {
|
2186
|
+
return typeof other == 'function' || other instanceof Function;
|
2187
|
+
}
|
2188
|
+
|
2189
|
+
if (this.expectedObject == Object) {
|
2190
|
+
return typeof other == 'object';
|
2191
|
+
}
|
2192
|
+
|
2193
|
+
if (this.expectedObject == Boolean) {
|
2194
|
+
return typeof other == 'boolean';
|
2195
|
+
}
|
2196
|
+
|
2197
|
+
return other instanceof this.expectedObject;
|
2198
|
+
};
|
2199
|
+
|
2200
|
+
Any.prototype.jasmineToString = function() {
|
2201
|
+
return '<jasmine.any(' + this.expectedObject + ')>';
|
2202
|
+
};
|
2203
|
+
|
2204
|
+
return Any;
|
2205
|
+
};
|
2206
|
+
|
2207
|
+
getJasmineRequireObj().Anything = function(j$) {
|
2208
|
+
|
2209
|
+
function Anything() {}
|
2210
|
+
|
2211
|
+
Anything.prototype.asymmetricMatch = function(other) {
|
2212
|
+
return !j$.util.isUndefined(other) && other !== null;
|
2213
|
+
};
|
2214
|
+
|
2215
|
+
Anything.prototype.jasmineToString = function() {
|
2216
|
+
return '<jasmine.anything>';
|
2217
|
+
};
|
2218
|
+
|
2219
|
+
return Anything;
|
2220
|
+
};
|
2221
|
+
|
2222
|
+
getJasmineRequireObj().ArrayContaining = function(j$) {
|
2223
|
+
function ArrayContaining(sample) {
|
2224
|
+
this.sample = sample;
|
2225
|
+
}
|
2226
|
+
|
2227
|
+
ArrayContaining.prototype.asymmetricMatch = function(other) {
|
2228
|
+
var className = Object.prototype.toString.call(this.sample);
|
2229
|
+
if (className !== '[object Array]') { throw new Error('You must provide an array to arrayContaining, not \'' + this.sample + '\'.'); }
|
2230
|
+
|
2231
|
+
for (var i = 0; i < this.sample.length; i++) {
|
2232
|
+
var item = this.sample[i];
|
2233
|
+
if (!j$.matchersUtil.contains(other, item)) {
|
2234
|
+
return false;
|
2235
|
+
}
|
2236
|
+
}
|
2237
|
+
|
2238
|
+
return true;
|
2239
|
+
};
|
2240
|
+
|
2241
|
+
ArrayContaining.prototype.jasmineToString = function () {
|
2242
|
+
return '<jasmine.arrayContaining(' + jasmine.pp(this.sample) +')>';
|
2243
|
+
};
|
2244
|
+
|
2245
|
+
return ArrayContaining;
|
2246
|
+
};
|
2247
|
+
|
2248
|
+
getJasmineRequireObj().ObjectContaining = function(j$) {
|
2249
|
+
|
2250
|
+
function ObjectContaining(sample) {
|
2251
|
+
this.sample = sample;
|
2252
|
+
}
|
2253
|
+
|
2254
|
+
ObjectContaining.prototype.asymmetricMatch = function(other) {
|
2255
|
+
if (typeof(this.sample) !== 'object') { throw new Error('You must provide an object to objectContaining, not \''+this.sample+'\'.'); }
|
2256
|
+
|
2257
|
+
for (var property in this.sample) {
|
2258
|
+
if (!Object.prototype.hasOwnProperty.call(other, property) ||
|
2259
|
+
!j$.matchersUtil.equals(this.sample[property], other[property])) {
|
2260
|
+
return false;
|
2261
|
+
}
|
2262
|
+
}
|
2263
|
+
|
2264
|
+
return true;
|
2265
|
+
};
|
2266
|
+
|
2267
|
+
ObjectContaining.prototype.jasmineToString = function() {
|
2268
|
+
return '<jasmine.objectContaining(' + j$.pp(this.sample) + ')>';
|
2269
|
+
};
|
2270
|
+
|
2271
|
+
return ObjectContaining;
|
2272
|
+
};
|
2273
|
+
|
2274
|
+
getJasmineRequireObj().StringMatching = function(j$) {
|
2275
|
+
|
2276
|
+
function StringMatching(expected) {
|
2277
|
+
if (!j$.isString_(expected) && !j$.isA_('RegExp', expected)) {
|
2278
|
+
throw new Error('Expected is not a String or a RegExp');
|
2279
|
+
}
|
2280
|
+
|
2281
|
+
this.regexp = new RegExp(expected);
|
2282
|
+
}
|
2283
|
+
|
2284
|
+
StringMatching.prototype.asymmetricMatch = function(other) {
|
2285
|
+
return this.regexp.test(other);
|
2286
|
+
};
|
2287
|
+
|
2288
|
+
StringMatching.prototype.jasmineToString = function() {
|
2289
|
+
return '<jasmine.stringMatching(' + this.regexp + ')>';
|
2290
|
+
};
|
2291
|
+
|
2292
|
+
return StringMatching;
|
2293
|
+
};
|
2294
|
+
|
2178
2295
|
getJasmineRequireObj().matchersUtil = function(j$) {
|
2179
2296
|
// TODO: what to do about jasmine.pp not being inject? move to JSON.stringify? gut PrettyPrinter?
|
2180
2297
|
|
@@ -2228,11 +2345,37 @@ getJasmineRequireObj().matchersUtil = function(j$) {
|
|
2228
2345
|
}
|
2229
2346
|
};
|
2230
2347
|
|
2348
|
+
function isAsymmetric(obj) {
|
2349
|
+
return obj && j$.isA_('Function', obj.asymmetricMatch);
|
2350
|
+
}
|
2351
|
+
|
2352
|
+
function asymmetricMatch(a, b) {
|
2353
|
+
var asymmetricA = isAsymmetric(a),
|
2354
|
+
asymmetricB = isAsymmetric(b);
|
2355
|
+
|
2356
|
+
if (asymmetricA && asymmetricB) {
|
2357
|
+
return undefined;
|
2358
|
+
}
|
2359
|
+
|
2360
|
+
if (asymmetricA) {
|
2361
|
+
return a.asymmetricMatch(b);
|
2362
|
+
}
|
2363
|
+
|
2364
|
+
if (asymmetricB) {
|
2365
|
+
return b.asymmetricMatch(a);
|
2366
|
+
}
|
2367
|
+
}
|
2368
|
+
|
2231
2369
|
// Equality function lovingly adapted from isEqual in
|
2232
2370
|
// [Underscore](http://underscorejs.org)
|
2233
2371
|
function eq(a, b, aStack, bStack, customTesters) {
|
2234
2372
|
var result = true;
|
2235
2373
|
|
2374
|
+
var asymmetricResult = asymmetricMatch(a, b);
|
2375
|
+
if (!j$.util.isUndefined(asymmetricResult)) {
|
2376
|
+
return asymmetricResult;
|
2377
|
+
}
|
2378
|
+
|
2236
2379
|
for (var i = 0; i < customTesters.length; i++) {
|
2237
2380
|
var customTesterResult = customTesters[i](a, b);
|
2238
2381
|
if (!j$.util.isUndefined(customTesterResult)) {
|
@@ -2240,27 +2383,6 @@ getJasmineRequireObj().matchersUtil = function(j$) {
|
|
2240
2383
|
}
|
2241
2384
|
}
|
2242
2385
|
|
2243
|
-
if (a instanceof j$.Any) {
|
2244
|
-
result = a.jasmineMatches(b);
|
2245
|
-
if (result) {
|
2246
|
-
return true;
|
2247
|
-
}
|
2248
|
-
}
|
2249
|
-
|
2250
|
-
if (b instanceof j$.Any) {
|
2251
|
-
result = b.jasmineMatches(a);
|
2252
|
-
if (result) {
|
2253
|
-
return true;
|
2254
|
-
}
|
2255
|
-
}
|
2256
|
-
|
2257
|
-
if (b instanceof j$.ObjectContaining) {
|
2258
|
-
result = b.jasmineMatches(a);
|
2259
|
-
if (result) {
|
2260
|
-
return true;
|
2261
|
-
}
|
2262
|
-
}
|
2263
|
-
|
2264
2386
|
if (a instanceof Error && b instanceof Error) {
|
2265
2387
|
return a.message == b.message;
|
2266
2388
|
}
|
@@ -2296,6 +2418,29 @@ getJasmineRequireObj().matchersUtil = function(j$) {
|
|
2296
2418
|
a.ignoreCase == b.ignoreCase;
|
2297
2419
|
}
|
2298
2420
|
if (typeof a != 'object' || typeof b != 'object') { return false; }
|
2421
|
+
|
2422
|
+
var aIsDomNode = j$.isDomNode(a);
|
2423
|
+
var bIsDomNode = j$.isDomNode(b);
|
2424
|
+
if (aIsDomNode && bIsDomNode) {
|
2425
|
+
// At first try to use DOM3 method isEqualNode
|
2426
|
+
if (a.isEqualNode) {
|
2427
|
+
return a.isEqualNode(b);
|
2428
|
+
}
|
2429
|
+
// IE8 doesn't support isEqualNode, try to use outerHTML && innerText
|
2430
|
+
var aIsElement = a instanceof Element;
|
2431
|
+
var bIsElement = b instanceof Element;
|
2432
|
+
if (aIsElement && bIsElement) {
|
2433
|
+
return a.outerHTML == b.outerHTML;
|
2434
|
+
}
|
2435
|
+
if (aIsElement || bIsElement) {
|
2436
|
+
return false;
|
2437
|
+
}
|
2438
|
+
return a.innerText == b.innerText && a.textContent == b.textContent;
|
2439
|
+
}
|
2440
|
+
if (aIsDomNode || bIsDomNode) {
|
2441
|
+
return false;
|
2442
|
+
}
|
2443
|
+
|
2299
2444
|
// Assume equality for cyclic structures. The algorithm for detecting cyclic
|
2300
2445
|
// structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.
|
2301
2446
|
var length = aStack.length;
|
@@ -2309,17 +2454,12 @@ getJasmineRequireObj().matchersUtil = function(j$) {
|
|
2309
2454
|
bStack.push(b);
|
2310
2455
|
var size = 0;
|
2311
2456
|
// Recursively compare objects and arrays.
|
2312
|
-
if
|
2313
|
-
|
2314
|
-
|
2315
|
-
|
2316
|
-
|
2317
|
-
|
2318
|
-
while (size--) {
|
2319
|
-
if (!(result = eq(a[size], b[size], aStack, bStack, customTesters))) { break; }
|
2320
|
-
}
|
2321
|
-
}
|
2322
|
-
} else {
|
2457
|
+
// Compare array lengths to determine if a deep comparison is necessary.
|
2458
|
+
if (className == '[object Array]' && a.length !== b.length) {
|
2459
|
+
result = false;
|
2460
|
+
}
|
2461
|
+
|
2462
|
+
if (result) {
|
2323
2463
|
// Objects with different constructors are not equivalent, but `Object`s
|
2324
2464
|
// from different frames are.
|
2325
2465
|
var aCtor = a.constructor, bCtor = b.constructor;
|
@@ -2351,7 +2491,7 @@ getJasmineRequireObj().matchersUtil = function(j$) {
|
|
2351
2491
|
return result;
|
2352
2492
|
|
2353
2493
|
function has(obj, key) {
|
2354
|
-
return
|
2494
|
+
return Object.prototype.hasOwnProperty.call(obj, key);
|
2355
2495
|
}
|
2356
2496
|
|
2357
2497
|
function isFunction(obj) {
|
@@ -2620,11 +2760,15 @@ getJasmineRequireObj().toHaveBeenCalledWith = function(j$) {
|
|
2620
2760
|
return toHaveBeenCalledWith;
|
2621
2761
|
};
|
2622
2762
|
|
2623
|
-
getJasmineRequireObj().toMatch = function() {
|
2763
|
+
getJasmineRequireObj().toMatch = function(j$) {
|
2624
2764
|
|
2625
2765
|
function toMatch() {
|
2626
2766
|
return {
|
2627
2767
|
compare: function(actual, expected) {
|
2768
|
+
if (!j$.isString_(expected) && !j$.isA_('RegExp', expected)) {
|
2769
|
+
throw new Error('Expected is not a String or a RegExp');
|
2770
|
+
}
|
2771
|
+
|
2628
2772
|
var regexp = new RegExp(expected);
|
2629
2773
|
|
2630
2774
|
return {
|
@@ -2717,7 +2861,7 @@ getJasmineRequireObj().toThrowError = function(j$) {
|
|
2717
2861
|
}
|
2718
2862
|
|
2719
2863
|
if (errorMatcher.hasNoSpecifics()) {
|
2720
|
-
pass.message = 'Expected function not to throw an Error, but it threw ' + fnNameFor(thrown) + '.';
|
2864
|
+
pass.message = 'Expected function not to throw an Error, but it threw ' + j$.fnNameFor(thrown) + '.';
|
2721
2865
|
return pass;
|
2722
2866
|
}
|
2723
2867
|
|
@@ -2771,9 +2915,9 @@ getJasmineRequireObj().toThrowError = function(j$) {
|
|
2771
2915
|
}
|
2772
2916
|
|
2773
2917
|
return {
|
2774
|
-
errorTypeDescription: errorType ? fnNameFor(errorType) : 'an exception',
|
2918
|
+
errorTypeDescription: errorType ? j$.fnNameFor(errorType) : 'an exception',
|
2775
2919
|
thrownDescription: function(thrown) {
|
2776
|
-
var thrownName = errorType ? fnNameFor(thrown.constructor) : 'an exception',
|
2920
|
+
var thrownName = errorType ? j$.fnNameFor(thrown.constructor) : 'an exception',
|
2777
2921
|
thrownMessage = '';
|
2778
2922
|
|
2779
2923
|
if (expected) {
|
@@ -2801,10 +2945,6 @@ getJasmineRequireObj().toThrowError = function(j$) {
|
|
2801
2945
|
};
|
2802
2946
|
}
|
2803
2947
|
|
2804
|
-
function fnNameFor(func) {
|
2805
|
-
return func.name || func.toString().match(/^\s*function\s*(\w*)\s*\(/)[1];
|
2806
|
-
}
|
2807
|
-
|
2808
2948
|
function isStringOrRegExp(potential) {
|
2809
2949
|
return potential instanceof RegExp || (typeof potential == 'string');
|
2810
2950
|
}
|
@@ -2837,32 +2977,32 @@ getJasmineRequireObj().interface = function(jasmine, env) {
|
|
2837
2977
|
return env.fdescribe(description, specDefinitions);
|
2838
2978
|
},
|
2839
2979
|
|
2840
|
-
it: function(
|
2841
|
-
return env.it(
|
2980
|
+
it: function() {
|
2981
|
+
return env.it.apply(env, arguments);
|
2842
2982
|
},
|
2843
2983
|
|
2844
|
-
xit: function(
|
2845
|
-
return env.xit(
|
2984
|
+
xit: function() {
|
2985
|
+
return env.xit.apply(env, arguments);
|
2846
2986
|
},
|
2847
2987
|
|
2848
|
-
fit: function(
|
2849
|
-
return env.fit(
|
2988
|
+
fit: function() {
|
2989
|
+
return env.fit.apply(env, arguments);
|
2850
2990
|
},
|
2851
2991
|
|
2852
|
-
beforeEach: function(
|
2853
|
-
return env.beforeEach(
|
2992
|
+
beforeEach: function() {
|
2993
|
+
return env.beforeEach.apply(env, arguments);
|
2854
2994
|
},
|
2855
2995
|
|
2856
|
-
afterEach: function(
|
2857
|
-
return env.afterEach(
|
2996
|
+
afterEach: function() {
|
2997
|
+
return env.afterEach.apply(env, arguments);
|
2858
2998
|
},
|
2859
2999
|
|
2860
|
-
beforeAll: function(
|
2861
|
-
return env.beforeAll(
|
3000
|
+
beforeAll: function() {
|
3001
|
+
return env.beforeAll.apply(env, arguments);
|
2862
3002
|
},
|
2863
3003
|
|
2864
|
-
afterAll: function(
|
2865
|
-
return env.afterAll(
|
3004
|
+
afterAll: function() {
|
3005
|
+
return env.afterAll.apply(env, arguments);
|
2866
3006
|
},
|
2867
3007
|
|
2868
3008
|
expect: function(actual) {
|
@@ -2870,7 +3010,7 @@ getJasmineRequireObj().interface = function(jasmine, env) {
|
|
2870
3010
|
},
|
2871
3011
|
|
2872
3012
|
pending: function() {
|
2873
|
-
return env.pending();
|
3013
|
+
return env.pending.apply(env, arguments);
|
2874
3014
|
},
|
2875
3015
|
|
2876
3016
|
fail: function() {
|
@@ -2904,5 +3044,5 @@ getJasmineRequireObj().interface = function(jasmine, env) {
|
|
2904
3044
|
};
|
2905
3045
|
|
2906
3046
|
getJasmineRequireObj().version = function() {
|
2907
|
-
return '2.
|
3047
|
+
return '2.2.0';
|
2908
3048
|
};
|