{:uriI"file:///Users/izik/www/sparse/izi_lightup/spec/javascripts/crit-utils/mini_require_spec.js?type=application/javascript&pipeline=self&id=853c3c19f6c228131a210e1df00d975221e11fcff12a33581e49a5c9d09f474a:ET:load_pathI"8/Users/izik/www/sparse/izi_lightup/spec/javascripts;T: filenameI"X/Users/izik/www/sparse/izi_lightup/spec/javascripts/crit-utils/mini_require_spec.js;T: nameI"!crit-utils/mini_require_spec;T:logical_pathI")crit-utils/mini_require_spec.self.js;T:content_typeI"application/javascript;T: sourceI"describe("miniRequire", function () { function $$clean() { for (var key in window.__required) { if (__required[key].node) __required[key].node.remove(); delete(__required[key]); } } beforeEach(function () { // TODO: clear extra scripts }); afterEach(function () { $$clean(); }); it("should exists as global function", function () { expect(miniRequire).toBeDefined(); expect(typeof miniRequire).toBe("function"); }); it("should inject new script", function() { var cnt = document.scripts.length; miniRequire("todo", "/assets/application.js"); expect(document.scripts.length - cnt).toBe(1); }); it("should inject only one script tag", function() { var cnt = document.scripts.length; miniRequire("todo", "/assets/application.js"); miniRequire("todo", "/assets/application.js"); miniRequire("todo", "/assets/application.js"); expect(document.scripts.length - cnt).toBe(1); }); }); describe("miniPreload", function () { it("should exists as global function", function () { expect(miniPreload).toBeDefined(); expect(typeof miniPreload).toBe("function"); }); }); ;T: metadata{ :dependencieso:Set: @hash} I"environment-version;TTI"environment-paths;TTI"rails-env;TTI"Zprocessors:type=application/javascript&file_type=application/javascript&pipeline=self;TTI"ffile-digest:///Users/izik/www/sparse/izi_lightup/spec/javascripts/crit-utils/mini_require_spec.js;TTF: requiredo;;}F: stubbedo;;}F: linkso;;}F: charsetI" utf-8;F: digest"%kh)eRem?pCN%: lengthi:dependencies_digest"%sS˸Mϧy(*x *`=5:idI"E853c3c19f6c228131a210e1df00d975221e11fcff12a33581e49a5c9d09f474a;F: mtimel+w]b