teabag 0.4.2 → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +99 -92
- data/app/assets/javascripts/teabag/base/fixture.coffee +99 -0
- data/app/assets/javascripts/teabag/base/teabag.coffee +1 -0
- data/app/assets/javascripts/teabag/jasmine.coffee +34 -2
- data/app/assets/javascripts/teabag/mocha.coffee +24 -2
- data/app/assets/javascripts/teabag/qunit.coffee +14 -5
- data/app/assets/javascripts/teabag-jasmine.js +244 -4
- data/app/assets/javascripts/teabag-mocha.js +228 -4
- data/app/assets/javascripts/teabag-qunit.js +200 -9
- data/app/assets/stylesheets/teabag.css +1 -0
- data/app/views/teabag/spec/index.html.erb +8 -9
- data/lib/generators/teabag/install/templates/initializer.rb +26 -28
- data/lib/teabag/suite.rb +9 -1
- data/lib/teabag/version.rb +1 -1
- data/spec/dummy/log/development.log +69910 -0
- data/spec/dummy/log/test.log +85 -0
- data/spec/dummy/tmp/cache/assets/C13/B50/sprockets%2F431452d41e5087d2211162d23c63789b +0 -0
- data/spec/dummy/tmp/cache/assets/C1C/2A0/sprockets%2F5820652740cdd23312489d2168c02e69 +0 -0
- data/spec/dummy/tmp/cache/assets/C59/250/sprockets%2Fa80d3fe493d2476e58c4323996064512 +0 -0
- data/spec/dummy/tmp/cache/assets/C72/150/sprockets%2F4194031b4b51b6422c14ac697e3455e5 +0 -0
- data/spec/dummy/tmp/cache/assets/C75/D50/sprockets%2F5302968a40e08d2c011aa38666d273f6 +0 -0
- data/spec/dummy/tmp/cache/assets/C8A/460/sprockets%2F77bffd9959420103906722b404ae8d59 +0 -0
- data/spec/dummy/tmp/cache/assets/C91/FA0/sprockets%2F2eb81283f5789ae91a69344552db3856 +0 -0
- data/spec/dummy/tmp/cache/assets/C9D/E90/sprockets%2F3045c9533f179d3e1c805d163ed002a0 +0 -0
- data/spec/dummy/tmp/cache/assets/CA6/2F0/sprockets%2F20040c18b672e4c4d2731a2a929d8b97 +0 -0
- data/spec/dummy/tmp/cache/assets/CA6/DF0/sprockets%2F7da83747ce56e49393b6b8726587f846 +0 -0
- data/spec/dummy/tmp/cache/assets/CA9/C40/sprockets%2F932b7e2cd1e067289ab51190800814df +0 -0
- data/spec/dummy/tmp/cache/assets/CAD/410/sprockets%2F651414e5c7e86f05c5108dc71626b25c +0 -0
- data/spec/dummy/tmp/cache/assets/CAF/0F0/sprockets%2F6000e67cf3f2377f860c24da7c819701 +0 -0
- data/spec/dummy/tmp/cache/assets/CB4/6A0/sprockets%2F7373c9de844b711519cb49c4f1b16822 +0 -0
- data/spec/dummy/tmp/cache/assets/CBB/FA0/sprockets%2F74922109263bdc965b2e9567eec6d154 +0 -0
- data/spec/dummy/tmp/cache/assets/CBD/AF0/sprockets%2Fd687ec33822256e9444e8cd04f1b4873 +0 -0
- data/spec/dummy/tmp/cache/assets/CBF/630/sprockets%2F707d2db81468088470d476abff35388d +0 -0
- data/spec/dummy/tmp/cache/assets/CC2/EC0/sprockets%2F76bf80cb571ca530357f78db78167866 +0 -0
- data/spec/dummy/tmp/cache/assets/CC8/830/sprockets%2F0b287580513a016ea8cc914bbfe03016 +0 -0
- data/spec/dummy/tmp/cache/assets/CCE/C50/sprockets%2Fe12774c2fea852112414bb379a71f31a +0 -0
- data/spec/dummy/tmp/cache/assets/CD1/620/sprockets%2F06a3eb05fcb4175a679d6084a06026a6 +0 -0
- data/spec/dummy/tmp/cache/assets/CD3/460/sprockets%2F7f3f6802b0b309ed142d0b671c9640c4 +0 -0
- data/spec/dummy/tmp/cache/assets/CE0/090/sprockets%2F48d5d35ae87d0723318b8bc257fa2237 +0 -0
- data/spec/dummy/tmp/cache/assets/CE6/270/sprockets%2F2c98152560d18470fec8cf4c6829b4d0 +0 -0
- data/spec/dummy/tmp/cache/assets/CE6/7C0/sprockets%2Fa03a2c86ce6724be8542295e1cf24798 +0 -0
- data/spec/dummy/tmp/cache/assets/CE7/A60/sprockets%2Ff58eee249aa167d23f8220087bb46684 +0 -0
- data/spec/dummy/tmp/cache/assets/CE9/9E0/sprockets%2F135480d497ed7e4884462dc0ef0b80d7 +0 -0
- data/spec/dummy/tmp/cache/assets/CEB/090/sprockets%2F55dcd7ace406b77208c380d496e37864 +0 -0
- data/spec/dummy/tmp/cache/assets/CEB/B40/sprockets%2F1150bf8d912aa100a132251eefaf6045 +0 -0
- data/spec/dummy/tmp/cache/assets/CF7/F10/sprockets%2F8c45854ebd195b52cc42bf3f99996336 +0 -0
- data/spec/dummy/tmp/cache/assets/CFA/D20/sprockets%2Fb26796b39b3c5d6ed70be7989637a493 +0 -0
- data/spec/dummy/tmp/cache/assets/CFC/380/sprockets%2Fa7443cbd671446a589867dd5f4a4f989 +0 -0
- data/spec/dummy/tmp/cache/assets/D00/110/sprockets%2F6a6353b7723a8b21708e0fbfe04bd422 +0 -0
- data/spec/dummy/tmp/cache/assets/D00/F60/sprockets%2F42e279b52511c47d26c0adb125fd04e8 +0 -0
- data/spec/dummy/tmp/cache/assets/D03/630/sprockets%2F5d8da32dba6a7be70426a1d554773701 +0 -0
- data/spec/dummy/tmp/cache/assets/D04/170/sprockets%2F76ab1dc02e6c7618852708a1e05a2df3 +0 -0
- data/spec/dummy/tmp/cache/assets/D04/480/sprockets%2F8bd8f10500b21d2f9d94e4cd1401c936 +0 -0
- data/spec/dummy/tmp/cache/assets/D05/8D0/sprockets%2F319f8f235f452343f1ebf03cb262d23d +0 -0
- data/spec/dummy/tmp/cache/assets/D09/BF0/sprockets%2F9e6bca5d26f50d9484385d51ba04312c +0 -0
- data/spec/dummy/tmp/cache/assets/D0B/740/sprockets%2F781d3a2f0449451e9f35c5b0e3e2df41 +0 -0
- data/spec/dummy/tmp/cache/assets/D0E/570/sprockets%2F90fe371bf8091e88a712124d9cdae260 +0 -0
- data/spec/dummy/tmp/cache/assets/D12/F40/sprockets%2Fb6f95541e256c15909e0a5a5fbf2a359 +0 -0
- data/spec/dummy/tmp/cache/assets/D1B/730/sprockets%2Fcf6ce779d043d29aae915f599a413380 +0 -0
- data/spec/dummy/tmp/cache/assets/D1E/AA0/sprockets%2F5c8741a556bc955cd36e61c88582b6dc +0 -0
- data/spec/dummy/tmp/cache/assets/D21/240/sprockets%2Ffdd497fc5d8257a9e4a0aa2473798184 +0 -0
- data/spec/dummy/tmp/cache/assets/D31/9C0/sprockets%2Fbd102a4f5a4985c3519dd6ab0295a1c6 +0 -0
- data/spec/dummy/tmp/cache/assets/D32/500/sprockets%2F6927df5a24d91c75d001e2b5600ab8be +0 -0
- data/spec/dummy/tmp/cache/assets/D35/7C0/sprockets%2Ff536a2606eaf7d542c0985104cb62baf +0 -0
- data/spec/dummy/tmp/cache/assets/D3C/840/sprockets%2Fc6202ec91d567a85bd3d46dc43ea9108 +0 -0
- data/spec/dummy/tmp/cache/assets/D44/E90/sprockets%2F05cfc0bf7c9938963d1d1c63248db80d +0 -0
- data/spec/dummy/tmp/cache/assets/D47/A90/sprockets%2Fe7ca382b607c595ea6505853f7fb63da +0 -0
- data/spec/dummy/tmp/cache/assets/D49/A10/sprockets%2Fc4656bd995a6f297c26d19b13aadb963 +0 -0
- data/spec/dummy/tmp/cache/assets/D50/D70/sprockets%2Fe2a3e6c95b11e0801a4eebae3a026026 +0 -0
- data/spec/dummy/tmp/cache/assets/D51/400/sprockets%2Ff5e433d8a31e80985b75ce598de236be +0 -0
- data/spec/dummy/tmp/cache/assets/D60/060/sprockets%2Fe8a6ac51dd42491eaa2f9130c1629eb2 +0 -0
- data/spec/dummy/tmp/cache/assets/D67/BC0/sprockets%2F35d2c2b45981ade5a2db2a9c7f37a615 +0 -0
- data/spec/dummy/tmp/cache/assets/D69/F90/sprockets%2F6a0795b7b38bd7e6142cd1b88211dade +0 -0
- data/spec/dummy/tmp/cache/assets/D6B/6E0/sprockets%2F266d99da1afe084cac250a6ba864c565 +0 -0
- data/spec/dummy/tmp/cache/assets/D6D/DA0/sprockets%2Fac936bf40b42227a2bf9d474ae9ec149 +0 -0
- data/spec/dummy/tmp/cache/assets/D6F/5B0/sprockets%2F5dcc801a7a6c340c5baf525839f9b8b6 +0 -0
- data/spec/dummy/tmp/cache/assets/D73/C00/sprockets%2F9cf4bfb486e4ab461e3f275a3d974c30 +0 -0
- data/spec/dummy/tmp/cache/assets/D78/2F0/sprockets%2F3c61f8915b8f717b1de788e6ecad122c +0 -0
- data/spec/dummy/tmp/cache/assets/D78/870/sprockets%2F8f3a7d4fcd104fa8e47f552f6630a49e +0 -0
- data/spec/dummy/tmp/cache/assets/D78/F10/sprockets%2Fa2d995664d1a9bf976c1bfbbb90f8710 +0 -0
- data/spec/dummy/tmp/cache/assets/D8C/520/sprockets%2F221cd58a042baac534d27e4cfedc1188 +0 -0
- data/spec/dummy/tmp/cache/assets/D93/BD0/sprockets%2Ff5e1b60201e08e3ddf8d3de5211f3d5e +0 -0
- data/spec/dummy/tmp/cache/assets/DA5/0A0/sprockets%2F7a4b5928cec69ab65afff309a04d6b47 +0 -0
- data/spec/dummy/tmp/cache/assets/DA6/D80/sprockets%2F8702dce2e6b9879a6add309e92ace2f0 +0 -0
- data/spec/dummy/tmp/cache/assets/DA8/C50/sprockets%2F0810627fddce930a399fc60d3be97fed +0 -0
- data/spec/dummy/tmp/cache/assets/DA9/BF0/sprockets%2Fc59f8f7bf494fe030610bc86bb7cc5e5 +0 -0
- data/spec/dummy/tmp/cache/assets/DAE/6C0/sprockets%2F77c7a8676aeefa73156c55dfcf51cc46 +0 -0
- data/spec/dummy/tmp/cache/assets/DB3/5D0/sprockets%2Fce1d4d75832c9bdeafd869f6f7b61725 +0 -0
- data/spec/dummy/tmp/cache/assets/DB5/040/sprockets%2F9a9da5df88713663b9fbc945facca891 +0 -0
- data/spec/dummy/tmp/cache/assets/DC4/860/sprockets%2Fa01a3cf460ff15daae0f928d0f85f52e +0 -0
- data/spec/dummy/tmp/cache/assets/DC7/A10/sprockets%2F84a8af0fcbf401864e1ae5bf092cba94 +0 -0
- data/spec/dummy/tmp/cache/assets/DE3/6C0/sprockets%2F51c550cc1b3b021aa9aede66a5a36aff +0 -0
- data/spec/dummy/tmp/cache/assets/DEB/110/sprockets%2F2dbdab0ce5babca645cdb5780004f875 +0 -0
- data/spec/dummy/tmp/cache/assets/DF6/0E0/sprockets%2F85b10db6e1afe643aba6d396abdd77f0 +0 -0
- data/spec/dummy/tmp/cache/assets/DF7/E10/sprockets%2F25e4253aba9a9adcefb72552fb1ff0c8 +0 -0
- data/spec/dummy/tmp/cache/assets/DFC/C20/sprockets%2Fd9178ad7e3b401c9fceafd64ea2b50d6 +0 -0
- data/spec/dummy/tmp/cache/assets/DFC/C30/sprockets%2Fb50a07cb30b0bd0eec8e98e5de79d65d +0 -0
- data/spec/dummy/tmp/cache/assets/E02/6E0/sprockets%2F63d6a5cdb8cefa64ef76b5c6e0fd3720 +0 -0
- data/spec/dummy/tmp/cache/assets/E08/F20/sprockets%2F4fc5cdcd6974efe7adfe809b30bd6513 +0 -0
- data/spec/dummy/tmp/cache/assets/E14/8E0/sprockets%2Fb8d902ffcf8758fde63d0fa579ba6d4e +0 -0
- data/spec/dummy/tmp/cache/assets/E16/D30/sprockets%2Fd69469e6e7439baacd8df989c0fdacc2 +0 -0
- data/spec/dummy/tmp/cache/assets/E17/EF0/sprockets%2Fa291ad64a26afd055dfadabbdf03f154 +0 -0
- data/spec/dummy/tmp/cache/assets/E2F/790/sprockets%2F7fac280deaa7ef20a77d5c9b5b9cfc34 +0 -0
- data/spec/dummy/tmp/cache/assets/E41/250/sprockets%2F97cf8fe3d7ffaff076f655aefb36da03 +0 -0
- data/spec/dummy/tmp/cache/assets/E6E/260/sprockets%2Fd9f8ab8b91ef582cc6c99a3ba0dedfe6 +0 -0
- data/spec/dummy/tmp/cache/assets/F79/360/sprockets%2F0ce035fefee5ebdabc8efabfbdbd6ee4 +0 -0
- data/spec/javascripts/fixtures/fixture.json +4 -0
- data/spec/javascripts/teabag/base/fixture_spec.coffee +93 -0
- data/spec/javascripts/teabag/jasmine/jasmine_jspec.coffee +16 -0
- data/spec/javascripts/teabag/mocha/mocha_mspec.coffee +16 -3
- data/spec/teabag/suite_spec.rb +23 -1
- metadata +15 -4
|
@@ -2696,6 +2696,186 @@ jasmine.version_= {
|
|
|
2696
2696
|
|
|
2697
2697
|
})();
|
|
2698
2698
|
|
|
2699
|
+
}).call(this);
|
|
2700
|
+
(function() {
|
|
2701
|
+
var __slice = [].slice;
|
|
2702
|
+
|
|
2703
|
+
Teabag.fixture = (function() {
|
|
2704
|
+
var addContent, cleanup, create, load, loadComplete, preload, putContent, set, xhr, xhrRequest,
|
|
2705
|
+
_this = this;
|
|
2706
|
+
|
|
2707
|
+
fixture.cache = {};
|
|
2708
|
+
|
|
2709
|
+
fixture.el = null;
|
|
2710
|
+
|
|
2711
|
+
fixture.json = [];
|
|
2712
|
+
|
|
2713
|
+
fixture.preload = function() {
|
|
2714
|
+
var url, urls, _i, _len, _results;
|
|
2715
|
+
urls = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
|
|
2716
|
+
_results = [];
|
|
2717
|
+
for (_i = 0, _len = urls.length; _i < _len; _i++) {
|
|
2718
|
+
url = urls[_i];
|
|
2719
|
+
_results.push(preload(url));
|
|
2720
|
+
}
|
|
2721
|
+
return _results;
|
|
2722
|
+
};
|
|
2723
|
+
|
|
2724
|
+
fixture.load = function() {
|
|
2725
|
+
var append, index, url, urls, _i, _j, _len, _results;
|
|
2726
|
+
urls = 2 <= arguments.length ? __slice.call(arguments, 0, _i = arguments.length - 1) : (_i = 0, []), append = arguments[_i++];
|
|
2727
|
+
if (append == null) {
|
|
2728
|
+
append = false;
|
|
2729
|
+
}
|
|
2730
|
+
if (typeof append !== "boolean") {
|
|
2731
|
+
urls.push(append);
|
|
2732
|
+
append = false;
|
|
2733
|
+
}
|
|
2734
|
+
_results = [];
|
|
2735
|
+
for (index = _j = 0, _len = urls.length; _j < _len; index = ++_j) {
|
|
2736
|
+
url = urls[index];
|
|
2737
|
+
_results.push(load(url, append || index > 0));
|
|
2738
|
+
}
|
|
2739
|
+
return _results;
|
|
2740
|
+
};
|
|
2741
|
+
|
|
2742
|
+
fixture.set = function() {
|
|
2743
|
+
var append, html, htmls, index, _i, _j, _len, _results;
|
|
2744
|
+
htmls = 2 <= arguments.length ? __slice.call(arguments, 0, _i = arguments.length - 1) : (_i = 0, []), append = arguments[_i++];
|
|
2745
|
+
if (append == null) {
|
|
2746
|
+
append = false;
|
|
2747
|
+
}
|
|
2748
|
+
if (typeof append !== "boolean") {
|
|
2749
|
+
htmls.push(append);
|
|
2750
|
+
append = false;
|
|
2751
|
+
}
|
|
2752
|
+
_results = [];
|
|
2753
|
+
for (index = _j = 0, _len = htmls.length; _j < _len; index = ++_j) {
|
|
2754
|
+
html = htmls[index];
|
|
2755
|
+
_results.push(set(html, append || index > 0));
|
|
2756
|
+
}
|
|
2757
|
+
return _results;
|
|
2758
|
+
};
|
|
2759
|
+
|
|
2760
|
+
fixture.cleanup = function() {
|
|
2761
|
+
return cleanup();
|
|
2762
|
+
};
|
|
2763
|
+
|
|
2764
|
+
function fixture() {
|
|
2765
|
+
Teabag.fixture.load.apply(window, arguments);
|
|
2766
|
+
}
|
|
2767
|
+
|
|
2768
|
+
xhr = null;
|
|
2769
|
+
|
|
2770
|
+
preload = function(url) {
|
|
2771
|
+
return load(url, false, true);
|
|
2772
|
+
};
|
|
2773
|
+
|
|
2774
|
+
load = function(url, append, preload) {
|
|
2775
|
+
var cached, value;
|
|
2776
|
+
if (preload == null) {
|
|
2777
|
+
preload = false;
|
|
2778
|
+
}
|
|
2779
|
+
if (cached = Teabag.fixture.cache[url]) {
|
|
2780
|
+
return loadComplete(url, cached.type, cached.content, append, preload);
|
|
2781
|
+
}
|
|
2782
|
+
value = null;
|
|
2783
|
+
xhrRequest(url, function() {
|
|
2784
|
+
if (xhr.readyState !== 4) {
|
|
2785
|
+
return;
|
|
2786
|
+
}
|
|
2787
|
+
if (xhr.status !== 200) {
|
|
2788
|
+
throw "Unable to load fixture \"" + url + "\".";
|
|
2789
|
+
}
|
|
2790
|
+
return value = loadComplete(url, xhr.getResponseHeader("content-type"), xhr.responseText, append, preload);
|
|
2791
|
+
});
|
|
2792
|
+
return value;
|
|
2793
|
+
};
|
|
2794
|
+
|
|
2795
|
+
loadComplete = function(url, type, content, append, preload) {
|
|
2796
|
+
Teabag.fixture.cache[url] = {
|
|
2797
|
+
type: type,
|
|
2798
|
+
content: content
|
|
2799
|
+
};
|
|
2800
|
+
if (type.match(/application\/json;/)) {
|
|
2801
|
+
return fixture.json[fixture.json.push(JSON.parse(content)) - 1];
|
|
2802
|
+
}
|
|
2803
|
+
if (preload) {
|
|
2804
|
+
return content;
|
|
2805
|
+
}
|
|
2806
|
+
if (append) {
|
|
2807
|
+
addContent(content);
|
|
2808
|
+
} else {
|
|
2809
|
+
putContent(content);
|
|
2810
|
+
}
|
|
2811
|
+
return Teabag.fixture.el;
|
|
2812
|
+
};
|
|
2813
|
+
|
|
2814
|
+
set = function(content, append) {
|
|
2815
|
+
if (append) {
|
|
2816
|
+
return addContent(content);
|
|
2817
|
+
} else {
|
|
2818
|
+
return putContent(content);
|
|
2819
|
+
}
|
|
2820
|
+
};
|
|
2821
|
+
|
|
2822
|
+
putContent = function(content) {
|
|
2823
|
+
cleanup();
|
|
2824
|
+
create();
|
|
2825
|
+
return Teabag.fixture.el.innerHTML = content;
|
|
2826
|
+
};
|
|
2827
|
+
|
|
2828
|
+
addContent = function(content) {
|
|
2829
|
+
if (!Teabag.fixture.el) {
|
|
2830
|
+
create();
|
|
2831
|
+
}
|
|
2832
|
+
return Teabag.fixture.el.innerHTML += content;
|
|
2833
|
+
};
|
|
2834
|
+
|
|
2835
|
+
create = function() {
|
|
2836
|
+
var _ref;
|
|
2837
|
+
Teabag.fixture.el = document.createElement("div");
|
|
2838
|
+
Teabag.fixture.el.id = "teabag-fixtures";
|
|
2839
|
+
return (_ref = document.body) != null ? _ref.appendChild(Teabag.fixture.el) : void 0;
|
|
2840
|
+
};
|
|
2841
|
+
|
|
2842
|
+
cleanup = function() {
|
|
2843
|
+
var _base, _ref, _ref1;
|
|
2844
|
+
(_base = Teabag.fixture).el || (_base.el = document.getElementById("teabag-fixtures"));
|
|
2845
|
+
if ((_ref = Teabag.fixture.el) != null) {
|
|
2846
|
+
if ((_ref1 = _ref.parentNode) != null) {
|
|
2847
|
+
_ref1.removeChild(Teabag.fixture.el);
|
|
2848
|
+
}
|
|
2849
|
+
}
|
|
2850
|
+
return Teabag.fixture.el = null;
|
|
2851
|
+
};
|
|
2852
|
+
|
|
2853
|
+
xhrRequest = function(url, callback) {
|
|
2854
|
+
if (window.XMLHttpRequest) {
|
|
2855
|
+
xhr = new XMLHttpRequest();
|
|
2856
|
+
} else if (window.ActiveXObject) {
|
|
2857
|
+
try {
|
|
2858
|
+
xhr = new ActiveXObject("Msxml2.XMLHTTP");
|
|
2859
|
+
} catch (e) {
|
|
2860
|
+
try {
|
|
2861
|
+
xhr = new ActiveXObject("Microsoft.XMLHTTP");
|
|
2862
|
+
} catch (e) {
|
|
2863
|
+
|
|
2864
|
+
}
|
|
2865
|
+
}
|
|
2866
|
+
}
|
|
2867
|
+
if (!xhr) {
|
|
2868
|
+
throw "Unable to make Ajax Request";
|
|
2869
|
+
}
|
|
2870
|
+
xhr.onreadystatechange = callback;
|
|
2871
|
+
xhr.open("GET", "" + Teabag.root + "/fixtures/" + url, false);
|
|
2872
|
+
return xhr.send();
|
|
2873
|
+
};
|
|
2874
|
+
|
|
2875
|
+
return fixture;
|
|
2876
|
+
|
|
2877
|
+
}).call(this);
|
|
2878
|
+
|
|
2699
2879
|
}).call(this);
|
|
2700
2880
|
(function() {
|
|
2701
2881
|
|
|
@@ -3417,16 +3597,14 @@ jasmine.version_= {
|
|
|
3417
3597
|
|
|
3418
3598
|
}).call(this);
|
|
3419
3599
|
(function() {
|
|
3420
|
-
var
|
|
3600
|
+
var env,
|
|
3601
|
+
__hasProp = {}.hasOwnProperty,
|
|
3421
3602
|
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
|
|
3422
3603
|
|
|
3423
3604
|
Teabag.Runner = (function(_super) {
|
|
3424
|
-
var env;
|
|
3425
3605
|
|
|
3426
3606
|
__extends(Runner, _super);
|
|
3427
3607
|
|
|
3428
|
-
env = jasmine.getEnv();
|
|
3429
|
-
|
|
3430
3608
|
function Runner() {
|
|
3431
3609
|
Runner.__super__.constructor.apply(this, arguments);
|
|
3432
3610
|
env.execute();
|
|
@@ -3545,4 +3723,66 @@ jasmine.version_= {
|
|
|
3545
3723
|
|
|
3546
3724
|
})();
|
|
3547
3725
|
|
|
3726
|
+
Teabag.fixture = (function(_super) {
|
|
3727
|
+
|
|
3728
|
+
__extends(fixture, _super);
|
|
3729
|
+
|
|
3730
|
+
function fixture() {
|
|
3731
|
+
return fixture.__super__.constructor.apply(this, arguments);
|
|
3732
|
+
}
|
|
3733
|
+
|
|
3734
|
+
window.fixture = fixture;
|
|
3735
|
+
|
|
3736
|
+
fixture.load = function() {
|
|
3737
|
+
var args,
|
|
3738
|
+
_this = this;
|
|
3739
|
+
args = arguments;
|
|
3740
|
+
if (!(env.currentSuite || env.currentSpec)) {
|
|
3741
|
+
throw "Teabag can't load fixtures outside of describe.";
|
|
3742
|
+
}
|
|
3743
|
+
if (env.currentSuite) {
|
|
3744
|
+
env.beforeEach(function() {
|
|
3745
|
+
return fixture.__super__.constructor.load.apply(_this, args);
|
|
3746
|
+
});
|
|
3747
|
+
env.afterEach(function() {
|
|
3748
|
+
return _this.cleanup();
|
|
3749
|
+
});
|
|
3750
|
+
return fixture.__super__.constructor.load.apply(this, arguments);
|
|
3751
|
+
} else {
|
|
3752
|
+
env.currentSpec.after(function() {
|
|
3753
|
+
return _this.cleanup();
|
|
3754
|
+
});
|
|
3755
|
+
return fixture.__super__.constructor.load.apply(this, arguments);
|
|
3756
|
+
}
|
|
3757
|
+
};
|
|
3758
|
+
|
|
3759
|
+
fixture.set = function() {
|
|
3760
|
+
var args,
|
|
3761
|
+
_this = this;
|
|
3762
|
+
args = arguments;
|
|
3763
|
+
if (!(env.currentSuite || env.currentSpec)) {
|
|
3764
|
+
throw "Teabag can't load fixtures outside of describe.";
|
|
3765
|
+
}
|
|
3766
|
+
if (env.currentSuite) {
|
|
3767
|
+
env.beforeEach(function() {
|
|
3768
|
+
return fixture.__super__.constructor.set.apply(_this, args);
|
|
3769
|
+
});
|
|
3770
|
+
env.afterEach(function() {
|
|
3771
|
+
return _this.cleanup();
|
|
3772
|
+
});
|
|
3773
|
+
return fixture.__super__.constructor.set.apply(this, arguments);
|
|
3774
|
+
} else {
|
|
3775
|
+
env.currentSpec.after(function() {
|
|
3776
|
+
return _this.cleanup();
|
|
3777
|
+
});
|
|
3778
|
+
return fixture.__super__.constructor.set.apply(this, arguments);
|
|
3779
|
+
}
|
|
3780
|
+
};
|
|
3781
|
+
|
|
3782
|
+
return fixture;
|
|
3783
|
+
|
|
3784
|
+
})(Teabag.fixture);
|
|
3785
|
+
|
|
3786
|
+
env = jasmine.getEnv();
|
|
3787
|
+
|
|
3548
3788
|
}).call(this);
|
|
@@ -5107,6 +5107,186 @@
|
|
|
5107
5107
|
|
|
5108
5108
|
})();
|
|
5109
5109
|
|
|
5110
|
+
}).call(this);
|
|
5111
|
+
(function() {
|
|
5112
|
+
var __slice = [].slice;
|
|
5113
|
+
|
|
5114
|
+
Teabag.fixture = (function() {
|
|
5115
|
+
var addContent, cleanup, create, load, loadComplete, preload, putContent, set, xhr, xhrRequest,
|
|
5116
|
+
_this = this;
|
|
5117
|
+
|
|
5118
|
+
fixture.cache = {};
|
|
5119
|
+
|
|
5120
|
+
fixture.el = null;
|
|
5121
|
+
|
|
5122
|
+
fixture.json = [];
|
|
5123
|
+
|
|
5124
|
+
fixture.preload = function() {
|
|
5125
|
+
var url, urls, _i, _len, _results;
|
|
5126
|
+
urls = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
|
|
5127
|
+
_results = [];
|
|
5128
|
+
for (_i = 0, _len = urls.length; _i < _len; _i++) {
|
|
5129
|
+
url = urls[_i];
|
|
5130
|
+
_results.push(preload(url));
|
|
5131
|
+
}
|
|
5132
|
+
return _results;
|
|
5133
|
+
};
|
|
5134
|
+
|
|
5135
|
+
fixture.load = function() {
|
|
5136
|
+
var append, index, url, urls, _i, _j, _len, _results;
|
|
5137
|
+
urls = 2 <= arguments.length ? __slice.call(arguments, 0, _i = arguments.length - 1) : (_i = 0, []), append = arguments[_i++];
|
|
5138
|
+
if (append == null) {
|
|
5139
|
+
append = false;
|
|
5140
|
+
}
|
|
5141
|
+
if (typeof append !== "boolean") {
|
|
5142
|
+
urls.push(append);
|
|
5143
|
+
append = false;
|
|
5144
|
+
}
|
|
5145
|
+
_results = [];
|
|
5146
|
+
for (index = _j = 0, _len = urls.length; _j < _len; index = ++_j) {
|
|
5147
|
+
url = urls[index];
|
|
5148
|
+
_results.push(load(url, append || index > 0));
|
|
5149
|
+
}
|
|
5150
|
+
return _results;
|
|
5151
|
+
};
|
|
5152
|
+
|
|
5153
|
+
fixture.set = function() {
|
|
5154
|
+
var append, html, htmls, index, _i, _j, _len, _results;
|
|
5155
|
+
htmls = 2 <= arguments.length ? __slice.call(arguments, 0, _i = arguments.length - 1) : (_i = 0, []), append = arguments[_i++];
|
|
5156
|
+
if (append == null) {
|
|
5157
|
+
append = false;
|
|
5158
|
+
}
|
|
5159
|
+
if (typeof append !== "boolean") {
|
|
5160
|
+
htmls.push(append);
|
|
5161
|
+
append = false;
|
|
5162
|
+
}
|
|
5163
|
+
_results = [];
|
|
5164
|
+
for (index = _j = 0, _len = htmls.length; _j < _len; index = ++_j) {
|
|
5165
|
+
html = htmls[index];
|
|
5166
|
+
_results.push(set(html, append || index > 0));
|
|
5167
|
+
}
|
|
5168
|
+
return _results;
|
|
5169
|
+
};
|
|
5170
|
+
|
|
5171
|
+
fixture.cleanup = function() {
|
|
5172
|
+
return cleanup();
|
|
5173
|
+
};
|
|
5174
|
+
|
|
5175
|
+
function fixture() {
|
|
5176
|
+
Teabag.fixture.load.apply(window, arguments);
|
|
5177
|
+
}
|
|
5178
|
+
|
|
5179
|
+
xhr = null;
|
|
5180
|
+
|
|
5181
|
+
preload = function(url) {
|
|
5182
|
+
return load(url, false, true);
|
|
5183
|
+
};
|
|
5184
|
+
|
|
5185
|
+
load = function(url, append, preload) {
|
|
5186
|
+
var cached, value;
|
|
5187
|
+
if (preload == null) {
|
|
5188
|
+
preload = false;
|
|
5189
|
+
}
|
|
5190
|
+
if (cached = Teabag.fixture.cache[url]) {
|
|
5191
|
+
return loadComplete(url, cached.type, cached.content, append, preload);
|
|
5192
|
+
}
|
|
5193
|
+
value = null;
|
|
5194
|
+
xhrRequest(url, function() {
|
|
5195
|
+
if (xhr.readyState !== 4) {
|
|
5196
|
+
return;
|
|
5197
|
+
}
|
|
5198
|
+
if (xhr.status !== 200) {
|
|
5199
|
+
throw "Unable to load fixture \"" + url + "\".";
|
|
5200
|
+
}
|
|
5201
|
+
return value = loadComplete(url, xhr.getResponseHeader("content-type"), xhr.responseText, append, preload);
|
|
5202
|
+
});
|
|
5203
|
+
return value;
|
|
5204
|
+
};
|
|
5205
|
+
|
|
5206
|
+
loadComplete = function(url, type, content, append, preload) {
|
|
5207
|
+
Teabag.fixture.cache[url] = {
|
|
5208
|
+
type: type,
|
|
5209
|
+
content: content
|
|
5210
|
+
};
|
|
5211
|
+
if (type.match(/application\/json;/)) {
|
|
5212
|
+
return fixture.json[fixture.json.push(JSON.parse(content)) - 1];
|
|
5213
|
+
}
|
|
5214
|
+
if (preload) {
|
|
5215
|
+
return content;
|
|
5216
|
+
}
|
|
5217
|
+
if (append) {
|
|
5218
|
+
addContent(content);
|
|
5219
|
+
} else {
|
|
5220
|
+
putContent(content);
|
|
5221
|
+
}
|
|
5222
|
+
return Teabag.fixture.el;
|
|
5223
|
+
};
|
|
5224
|
+
|
|
5225
|
+
set = function(content, append) {
|
|
5226
|
+
if (append) {
|
|
5227
|
+
return addContent(content);
|
|
5228
|
+
} else {
|
|
5229
|
+
return putContent(content);
|
|
5230
|
+
}
|
|
5231
|
+
};
|
|
5232
|
+
|
|
5233
|
+
putContent = function(content) {
|
|
5234
|
+
cleanup();
|
|
5235
|
+
create();
|
|
5236
|
+
return Teabag.fixture.el.innerHTML = content;
|
|
5237
|
+
};
|
|
5238
|
+
|
|
5239
|
+
addContent = function(content) {
|
|
5240
|
+
if (!Teabag.fixture.el) {
|
|
5241
|
+
create();
|
|
5242
|
+
}
|
|
5243
|
+
return Teabag.fixture.el.innerHTML += content;
|
|
5244
|
+
};
|
|
5245
|
+
|
|
5246
|
+
create = function() {
|
|
5247
|
+
var _ref;
|
|
5248
|
+
Teabag.fixture.el = document.createElement("div");
|
|
5249
|
+
Teabag.fixture.el.id = "teabag-fixtures";
|
|
5250
|
+
return (_ref = document.body) != null ? _ref.appendChild(Teabag.fixture.el) : void 0;
|
|
5251
|
+
};
|
|
5252
|
+
|
|
5253
|
+
cleanup = function() {
|
|
5254
|
+
var _base, _ref, _ref1;
|
|
5255
|
+
(_base = Teabag.fixture).el || (_base.el = document.getElementById("teabag-fixtures"));
|
|
5256
|
+
if ((_ref = Teabag.fixture.el) != null) {
|
|
5257
|
+
if ((_ref1 = _ref.parentNode) != null) {
|
|
5258
|
+
_ref1.removeChild(Teabag.fixture.el);
|
|
5259
|
+
}
|
|
5260
|
+
}
|
|
5261
|
+
return Teabag.fixture.el = null;
|
|
5262
|
+
};
|
|
5263
|
+
|
|
5264
|
+
xhrRequest = function(url, callback) {
|
|
5265
|
+
if (window.XMLHttpRequest) {
|
|
5266
|
+
xhr = new XMLHttpRequest();
|
|
5267
|
+
} else if (window.ActiveXObject) {
|
|
5268
|
+
try {
|
|
5269
|
+
xhr = new ActiveXObject("Msxml2.XMLHTTP");
|
|
5270
|
+
} catch (e) {
|
|
5271
|
+
try {
|
|
5272
|
+
xhr = new ActiveXObject("Microsoft.XMLHTTP");
|
|
5273
|
+
} catch (e) {
|
|
5274
|
+
|
|
5275
|
+
}
|
|
5276
|
+
}
|
|
5277
|
+
}
|
|
5278
|
+
if (!xhr) {
|
|
5279
|
+
throw "Unable to make Ajax Request";
|
|
5280
|
+
}
|
|
5281
|
+
xhr.onreadystatechange = callback;
|
|
5282
|
+
xhr.open("GET", "" + Teabag.root + "/fixtures/" + url, false);
|
|
5283
|
+
return xhr.send();
|
|
5284
|
+
};
|
|
5285
|
+
|
|
5286
|
+
return fixture;
|
|
5287
|
+
|
|
5288
|
+
}).call(this);
|
|
5289
|
+
|
|
5110
5290
|
}).call(this);
|
|
5111
5291
|
(function() {
|
|
5112
5292
|
|
|
@@ -5883,19 +6063,21 @@
|
|
|
5883
6063
|
|
|
5884
6064
|
}).call(this);
|
|
5885
6065
|
(function() {
|
|
5886
|
-
var
|
|
6066
|
+
var env,
|
|
6067
|
+
__hasProp = {}.hasOwnProperty,
|
|
5887
6068
|
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
|
|
5888
6069
|
|
|
5889
6070
|
Teabag.Runner = (function(_super) {
|
|
5890
|
-
var env;
|
|
5891
6071
|
|
|
5892
6072
|
__extends(Runner, _super);
|
|
5893
6073
|
|
|
5894
|
-
env = mocha.setup("bdd");
|
|
5895
|
-
|
|
5896
6074
|
function Runner() {
|
|
5897
6075
|
Runner.__super__.constructor.apply(this, arguments);
|
|
5898
6076
|
env.run();
|
|
6077
|
+
env.started = true;
|
|
6078
|
+
afterEach(function() {
|
|
6079
|
+
return Teabag.fixture.cleanup();
|
|
6080
|
+
});
|
|
5899
6081
|
}
|
|
5900
6082
|
|
|
5901
6083
|
Runner.prototype.setup = function() {
|
|
@@ -5980,4 +6162,46 @@
|
|
|
5980
6162
|
|
|
5981
6163
|
})();
|
|
5982
6164
|
|
|
6165
|
+
Teabag.fixture = (function(_super) {
|
|
6166
|
+
|
|
6167
|
+
__extends(fixture, _super);
|
|
6168
|
+
|
|
6169
|
+
function fixture() {
|
|
6170
|
+
return fixture.__super__.constructor.apply(this, arguments);
|
|
6171
|
+
}
|
|
6172
|
+
|
|
6173
|
+
window.fixture = fixture;
|
|
6174
|
+
|
|
6175
|
+
fixture.load = function() {
|
|
6176
|
+
var args,
|
|
6177
|
+
_this = this;
|
|
6178
|
+
args = arguments;
|
|
6179
|
+
if (env.started) {
|
|
6180
|
+
return fixture.__super__.constructor.load.apply(this, arguments);
|
|
6181
|
+
} else {
|
|
6182
|
+
return beforeEach(function() {
|
|
6183
|
+
return fixture.__super__.constructor.load.apply(_this, args);
|
|
6184
|
+
});
|
|
6185
|
+
}
|
|
6186
|
+
};
|
|
6187
|
+
|
|
6188
|
+
fixture.set = function() {
|
|
6189
|
+
var args,
|
|
6190
|
+
_this = this;
|
|
6191
|
+
args = arguments;
|
|
6192
|
+
if (env.started) {
|
|
6193
|
+
return fixture.__super__.constructor.set.apply(this, arguments);
|
|
6194
|
+
} else {
|
|
6195
|
+
return beforeEach(function() {
|
|
6196
|
+
return fixture.__super__.constructor.set.apply(_this, args);
|
|
6197
|
+
});
|
|
6198
|
+
}
|
|
6199
|
+
};
|
|
6200
|
+
|
|
6201
|
+
return fixture;
|
|
6202
|
+
|
|
6203
|
+
})(Teabag.fixture);
|
|
6204
|
+
|
|
6205
|
+
env = mocha.setup("bdd");
|
|
6206
|
+
|
|
5983
6207
|
}).call(this);
|