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.
Files changed (112) hide show
  1. data/README.md +99 -92
  2. data/app/assets/javascripts/teabag/base/fixture.coffee +99 -0
  3. data/app/assets/javascripts/teabag/base/teabag.coffee +1 -0
  4. data/app/assets/javascripts/teabag/jasmine.coffee +34 -2
  5. data/app/assets/javascripts/teabag/mocha.coffee +24 -2
  6. data/app/assets/javascripts/teabag/qunit.coffee +14 -5
  7. data/app/assets/javascripts/teabag-jasmine.js +244 -4
  8. data/app/assets/javascripts/teabag-mocha.js +228 -4
  9. data/app/assets/javascripts/teabag-qunit.js +200 -9
  10. data/app/assets/stylesheets/teabag.css +1 -0
  11. data/app/views/teabag/spec/index.html.erb +8 -9
  12. data/lib/generators/teabag/install/templates/initializer.rb +26 -28
  13. data/lib/teabag/suite.rb +9 -1
  14. data/lib/teabag/version.rb +1 -1
  15. data/spec/dummy/log/development.log +69910 -0
  16. data/spec/dummy/log/test.log +85 -0
  17. data/spec/dummy/tmp/cache/assets/C13/B50/sprockets%2F431452d41e5087d2211162d23c63789b +0 -0
  18. data/spec/dummy/tmp/cache/assets/C1C/2A0/sprockets%2F5820652740cdd23312489d2168c02e69 +0 -0
  19. data/spec/dummy/tmp/cache/assets/C59/250/sprockets%2Fa80d3fe493d2476e58c4323996064512 +0 -0
  20. data/spec/dummy/tmp/cache/assets/C72/150/sprockets%2F4194031b4b51b6422c14ac697e3455e5 +0 -0
  21. data/spec/dummy/tmp/cache/assets/C75/D50/sprockets%2F5302968a40e08d2c011aa38666d273f6 +0 -0
  22. data/spec/dummy/tmp/cache/assets/C8A/460/sprockets%2F77bffd9959420103906722b404ae8d59 +0 -0
  23. data/spec/dummy/tmp/cache/assets/C91/FA0/sprockets%2F2eb81283f5789ae91a69344552db3856 +0 -0
  24. data/spec/dummy/tmp/cache/assets/C9D/E90/sprockets%2F3045c9533f179d3e1c805d163ed002a0 +0 -0
  25. data/spec/dummy/tmp/cache/assets/CA6/2F0/sprockets%2F20040c18b672e4c4d2731a2a929d8b97 +0 -0
  26. data/spec/dummy/tmp/cache/assets/CA6/DF0/sprockets%2F7da83747ce56e49393b6b8726587f846 +0 -0
  27. data/spec/dummy/tmp/cache/assets/CA9/C40/sprockets%2F932b7e2cd1e067289ab51190800814df +0 -0
  28. data/spec/dummy/tmp/cache/assets/CAD/410/sprockets%2F651414e5c7e86f05c5108dc71626b25c +0 -0
  29. data/spec/dummy/tmp/cache/assets/CAF/0F0/sprockets%2F6000e67cf3f2377f860c24da7c819701 +0 -0
  30. data/spec/dummy/tmp/cache/assets/CB4/6A0/sprockets%2F7373c9de844b711519cb49c4f1b16822 +0 -0
  31. data/spec/dummy/tmp/cache/assets/CBB/FA0/sprockets%2F74922109263bdc965b2e9567eec6d154 +0 -0
  32. data/spec/dummy/tmp/cache/assets/CBD/AF0/sprockets%2Fd687ec33822256e9444e8cd04f1b4873 +0 -0
  33. data/spec/dummy/tmp/cache/assets/CBF/630/sprockets%2F707d2db81468088470d476abff35388d +0 -0
  34. data/spec/dummy/tmp/cache/assets/CC2/EC0/sprockets%2F76bf80cb571ca530357f78db78167866 +0 -0
  35. data/spec/dummy/tmp/cache/assets/CC8/830/sprockets%2F0b287580513a016ea8cc914bbfe03016 +0 -0
  36. data/spec/dummy/tmp/cache/assets/CCE/C50/sprockets%2Fe12774c2fea852112414bb379a71f31a +0 -0
  37. data/spec/dummy/tmp/cache/assets/CD1/620/sprockets%2F06a3eb05fcb4175a679d6084a06026a6 +0 -0
  38. data/spec/dummy/tmp/cache/assets/CD3/460/sprockets%2F7f3f6802b0b309ed142d0b671c9640c4 +0 -0
  39. data/spec/dummy/tmp/cache/assets/CE0/090/sprockets%2F48d5d35ae87d0723318b8bc257fa2237 +0 -0
  40. data/spec/dummy/tmp/cache/assets/CE6/270/sprockets%2F2c98152560d18470fec8cf4c6829b4d0 +0 -0
  41. data/spec/dummy/tmp/cache/assets/CE6/7C0/sprockets%2Fa03a2c86ce6724be8542295e1cf24798 +0 -0
  42. data/spec/dummy/tmp/cache/assets/CE7/A60/sprockets%2Ff58eee249aa167d23f8220087bb46684 +0 -0
  43. data/spec/dummy/tmp/cache/assets/CE9/9E0/sprockets%2F135480d497ed7e4884462dc0ef0b80d7 +0 -0
  44. data/spec/dummy/tmp/cache/assets/CEB/090/sprockets%2F55dcd7ace406b77208c380d496e37864 +0 -0
  45. data/spec/dummy/tmp/cache/assets/CEB/B40/sprockets%2F1150bf8d912aa100a132251eefaf6045 +0 -0
  46. data/spec/dummy/tmp/cache/assets/CF7/F10/sprockets%2F8c45854ebd195b52cc42bf3f99996336 +0 -0
  47. data/spec/dummy/tmp/cache/assets/CFA/D20/sprockets%2Fb26796b39b3c5d6ed70be7989637a493 +0 -0
  48. data/spec/dummy/tmp/cache/assets/CFC/380/sprockets%2Fa7443cbd671446a589867dd5f4a4f989 +0 -0
  49. data/spec/dummy/tmp/cache/assets/D00/110/sprockets%2F6a6353b7723a8b21708e0fbfe04bd422 +0 -0
  50. data/spec/dummy/tmp/cache/assets/D00/F60/sprockets%2F42e279b52511c47d26c0adb125fd04e8 +0 -0
  51. data/spec/dummy/tmp/cache/assets/D03/630/sprockets%2F5d8da32dba6a7be70426a1d554773701 +0 -0
  52. data/spec/dummy/tmp/cache/assets/D04/170/sprockets%2F76ab1dc02e6c7618852708a1e05a2df3 +0 -0
  53. data/spec/dummy/tmp/cache/assets/D04/480/sprockets%2F8bd8f10500b21d2f9d94e4cd1401c936 +0 -0
  54. data/spec/dummy/tmp/cache/assets/D05/8D0/sprockets%2F319f8f235f452343f1ebf03cb262d23d +0 -0
  55. data/spec/dummy/tmp/cache/assets/D09/BF0/sprockets%2F9e6bca5d26f50d9484385d51ba04312c +0 -0
  56. data/spec/dummy/tmp/cache/assets/D0B/740/sprockets%2F781d3a2f0449451e9f35c5b0e3e2df41 +0 -0
  57. data/spec/dummy/tmp/cache/assets/D0E/570/sprockets%2F90fe371bf8091e88a712124d9cdae260 +0 -0
  58. data/spec/dummy/tmp/cache/assets/D12/F40/sprockets%2Fb6f95541e256c15909e0a5a5fbf2a359 +0 -0
  59. data/spec/dummy/tmp/cache/assets/D1B/730/sprockets%2Fcf6ce779d043d29aae915f599a413380 +0 -0
  60. data/spec/dummy/tmp/cache/assets/D1E/AA0/sprockets%2F5c8741a556bc955cd36e61c88582b6dc +0 -0
  61. data/spec/dummy/tmp/cache/assets/D21/240/sprockets%2Ffdd497fc5d8257a9e4a0aa2473798184 +0 -0
  62. data/spec/dummy/tmp/cache/assets/D31/9C0/sprockets%2Fbd102a4f5a4985c3519dd6ab0295a1c6 +0 -0
  63. data/spec/dummy/tmp/cache/assets/D32/500/sprockets%2F6927df5a24d91c75d001e2b5600ab8be +0 -0
  64. data/spec/dummy/tmp/cache/assets/D35/7C0/sprockets%2Ff536a2606eaf7d542c0985104cb62baf +0 -0
  65. data/spec/dummy/tmp/cache/assets/D3C/840/sprockets%2Fc6202ec91d567a85bd3d46dc43ea9108 +0 -0
  66. data/spec/dummy/tmp/cache/assets/D44/E90/sprockets%2F05cfc0bf7c9938963d1d1c63248db80d +0 -0
  67. data/spec/dummy/tmp/cache/assets/D47/A90/sprockets%2Fe7ca382b607c595ea6505853f7fb63da +0 -0
  68. data/spec/dummy/tmp/cache/assets/D49/A10/sprockets%2Fc4656bd995a6f297c26d19b13aadb963 +0 -0
  69. data/spec/dummy/tmp/cache/assets/D50/D70/sprockets%2Fe2a3e6c95b11e0801a4eebae3a026026 +0 -0
  70. data/spec/dummy/tmp/cache/assets/D51/400/sprockets%2Ff5e433d8a31e80985b75ce598de236be +0 -0
  71. data/spec/dummy/tmp/cache/assets/D60/060/sprockets%2Fe8a6ac51dd42491eaa2f9130c1629eb2 +0 -0
  72. data/spec/dummy/tmp/cache/assets/D67/BC0/sprockets%2F35d2c2b45981ade5a2db2a9c7f37a615 +0 -0
  73. data/spec/dummy/tmp/cache/assets/D69/F90/sprockets%2F6a0795b7b38bd7e6142cd1b88211dade +0 -0
  74. data/spec/dummy/tmp/cache/assets/D6B/6E0/sprockets%2F266d99da1afe084cac250a6ba864c565 +0 -0
  75. data/spec/dummy/tmp/cache/assets/D6D/DA0/sprockets%2Fac936bf40b42227a2bf9d474ae9ec149 +0 -0
  76. data/spec/dummy/tmp/cache/assets/D6F/5B0/sprockets%2F5dcc801a7a6c340c5baf525839f9b8b6 +0 -0
  77. data/spec/dummy/tmp/cache/assets/D73/C00/sprockets%2F9cf4bfb486e4ab461e3f275a3d974c30 +0 -0
  78. data/spec/dummy/tmp/cache/assets/D78/2F0/sprockets%2F3c61f8915b8f717b1de788e6ecad122c +0 -0
  79. data/spec/dummy/tmp/cache/assets/D78/870/sprockets%2F8f3a7d4fcd104fa8e47f552f6630a49e +0 -0
  80. data/spec/dummy/tmp/cache/assets/D78/F10/sprockets%2Fa2d995664d1a9bf976c1bfbbb90f8710 +0 -0
  81. data/spec/dummy/tmp/cache/assets/D8C/520/sprockets%2F221cd58a042baac534d27e4cfedc1188 +0 -0
  82. data/spec/dummy/tmp/cache/assets/D93/BD0/sprockets%2Ff5e1b60201e08e3ddf8d3de5211f3d5e +0 -0
  83. data/spec/dummy/tmp/cache/assets/DA5/0A0/sprockets%2F7a4b5928cec69ab65afff309a04d6b47 +0 -0
  84. data/spec/dummy/tmp/cache/assets/DA6/D80/sprockets%2F8702dce2e6b9879a6add309e92ace2f0 +0 -0
  85. data/spec/dummy/tmp/cache/assets/DA8/C50/sprockets%2F0810627fddce930a399fc60d3be97fed +0 -0
  86. data/spec/dummy/tmp/cache/assets/DA9/BF0/sprockets%2Fc59f8f7bf494fe030610bc86bb7cc5e5 +0 -0
  87. data/spec/dummy/tmp/cache/assets/DAE/6C0/sprockets%2F77c7a8676aeefa73156c55dfcf51cc46 +0 -0
  88. data/spec/dummy/tmp/cache/assets/DB3/5D0/sprockets%2Fce1d4d75832c9bdeafd869f6f7b61725 +0 -0
  89. data/spec/dummy/tmp/cache/assets/DB5/040/sprockets%2F9a9da5df88713663b9fbc945facca891 +0 -0
  90. data/spec/dummy/tmp/cache/assets/DC4/860/sprockets%2Fa01a3cf460ff15daae0f928d0f85f52e +0 -0
  91. data/spec/dummy/tmp/cache/assets/DC7/A10/sprockets%2F84a8af0fcbf401864e1ae5bf092cba94 +0 -0
  92. data/spec/dummy/tmp/cache/assets/DE3/6C0/sprockets%2F51c550cc1b3b021aa9aede66a5a36aff +0 -0
  93. data/spec/dummy/tmp/cache/assets/DEB/110/sprockets%2F2dbdab0ce5babca645cdb5780004f875 +0 -0
  94. data/spec/dummy/tmp/cache/assets/DF6/0E0/sprockets%2F85b10db6e1afe643aba6d396abdd77f0 +0 -0
  95. data/spec/dummy/tmp/cache/assets/DF7/E10/sprockets%2F25e4253aba9a9adcefb72552fb1ff0c8 +0 -0
  96. data/spec/dummy/tmp/cache/assets/DFC/C20/sprockets%2Fd9178ad7e3b401c9fceafd64ea2b50d6 +0 -0
  97. data/spec/dummy/tmp/cache/assets/DFC/C30/sprockets%2Fb50a07cb30b0bd0eec8e98e5de79d65d +0 -0
  98. data/spec/dummy/tmp/cache/assets/E02/6E0/sprockets%2F63d6a5cdb8cefa64ef76b5c6e0fd3720 +0 -0
  99. data/spec/dummy/tmp/cache/assets/E08/F20/sprockets%2F4fc5cdcd6974efe7adfe809b30bd6513 +0 -0
  100. data/spec/dummy/tmp/cache/assets/E14/8E0/sprockets%2Fb8d902ffcf8758fde63d0fa579ba6d4e +0 -0
  101. data/spec/dummy/tmp/cache/assets/E16/D30/sprockets%2Fd69469e6e7439baacd8df989c0fdacc2 +0 -0
  102. data/spec/dummy/tmp/cache/assets/E17/EF0/sprockets%2Fa291ad64a26afd055dfadabbdf03f154 +0 -0
  103. data/spec/dummy/tmp/cache/assets/E2F/790/sprockets%2F7fac280deaa7ef20a77d5c9b5b9cfc34 +0 -0
  104. data/spec/dummy/tmp/cache/assets/E41/250/sprockets%2F97cf8fe3d7ffaff076f655aefb36da03 +0 -0
  105. data/spec/dummy/tmp/cache/assets/E6E/260/sprockets%2Fd9f8ab8b91ef582cc6c99a3ba0dedfe6 +0 -0
  106. data/spec/dummy/tmp/cache/assets/F79/360/sprockets%2F0ce035fefee5ebdabc8efabfbdbd6ee4 +0 -0
  107. data/spec/javascripts/fixtures/fixture.json +4 -0
  108. data/spec/javascripts/teabag/base/fixture_spec.coffee +93 -0
  109. data/spec/javascripts/teabag/jasmine/jasmine_jspec.coffee +16 -0
  110. data/spec/javascripts/teabag/mocha/mocha_mspec.coffee +16 -3
  111. data/spec/teabag/suite_spec.rb +23 -1
  112. metadata +15 -4
@@ -2072,6 +2072,186 @@
2072
2072
 
2073
2073
  })();
2074
2074
 
2075
+ }).call(this);
2076
+ (function() {
2077
+ var __slice = [].slice;
2078
+
2079
+ Teabag.fixture = (function() {
2080
+ var addContent, cleanup, create, load, loadComplete, preload, putContent, set, xhr, xhrRequest,
2081
+ _this = this;
2082
+
2083
+ fixture.cache = {};
2084
+
2085
+ fixture.el = null;
2086
+
2087
+ fixture.json = [];
2088
+
2089
+ fixture.preload = function() {
2090
+ var url, urls, _i, _len, _results;
2091
+ urls = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
2092
+ _results = [];
2093
+ for (_i = 0, _len = urls.length; _i < _len; _i++) {
2094
+ url = urls[_i];
2095
+ _results.push(preload(url));
2096
+ }
2097
+ return _results;
2098
+ };
2099
+
2100
+ fixture.load = function() {
2101
+ var append, index, url, urls, _i, _j, _len, _results;
2102
+ urls = 2 <= arguments.length ? __slice.call(arguments, 0, _i = arguments.length - 1) : (_i = 0, []), append = arguments[_i++];
2103
+ if (append == null) {
2104
+ append = false;
2105
+ }
2106
+ if (typeof append !== "boolean") {
2107
+ urls.push(append);
2108
+ append = false;
2109
+ }
2110
+ _results = [];
2111
+ for (index = _j = 0, _len = urls.length; _j < _len; index = ++_j) {
2112
+ url = urls[index];
2113
+ _results.push(load(url, append || index > 0));
2114
+ }
2115
+ return _results;
2116
+ };
2117
+
2118
+ fixture.set = function() {
2119
+ var append, html, htmls, index, _i, _j, _len, _results;
2120
+ htmls = 2 <= arguments.length ? __slice.call(arguments, 0, _i = arguments.length - 1) : (_i = 0, []), append = arguments[_i++];
2121
+ if (append == null) {
2122
+ append = false;
2123
+ }
2124
+ if (typeof append !== "boolean") {
2125
+ htmls.push(append);
2126
+ append = false;
2127
+ }
2128
+ _results = [];
2129
+ for (index = _j = 0, _len = htmls.length; _j < _len; index = ++_j) {
2130
+ html = htmls[index];
2131
+ _results.push(set(html, append || index > 0));
2132
+ }
2133
+ return _results;
2134
+ };
2135
+
2136
+ fixture.cleanup = function() {
2137
+ return cleanup();
2138
+ };
2139
+
2140
+ function fixture() {
2141
+ Teabag.fixture.load.apply(window, arguments);
2142
+ }
2143
+
2144
+ xhr = null;
2145
+
2146
+ preload = function(url) {
2147
+ return load(url, false, true);
2148
+ };
2149
+
2150
+ load = function(url, append, preload) {
2151
+ var cached, value;
2152
+ if (preload == null) {
2153
+ preload = false;
2154
+ }
2155
+ if (cached = Teabag.fixture.cache[url]) {
2156
+ return loadComplete(url, cached.type, cached.content, append, preload);
2157
+ }
2158
+ value = null;
2159
+ xhrRequest(url, function() {
2160
+ if (xhr.readyState !== 4) {
2161
+ return;
2162
+ }
2163
+ if (xhr.status !== 200) {
2164
+ throw "Unable to load fixture \"" + url + "\".";
2165
+ }
2166
+ return value = loadComplete(url, xhr.getResponseHeader("content-type"), xhr.responseText, append, preload);
2167
+ });
2168
+ return value;
2169
+ };
2170
+
2171
+ loadComplete = function(url, type, content, append, preload) {
2172
+ Teabag.fixture.cache[url] = {
2173
+ type: type,
2174
+ content: content
2175
+ };
2176
+ if (type.match(/application\/json;/)) {
2177
+ return fixture.json[fixture.json.push(JSON.parse(content)) - 1];
2178
+ }
2179
+ if (preload) {
2180
+ return content;
2181
+ }
2182
+ if (append) {
2183
+ addContent(content);
2184
+ } else {
2185
+ putContent(content);
2186
+ }
2187
+ return Teabag.fixture.el;
2188
+ };
2189
+
2190
+ set = function(content, append) {
2191
+ if (append) {
2192
+ return addContent(content);
2193
+ } else {
2194
+ return putContent(content);
2195
+ }
2196
+ };
2197
+
2198
+ putContent = function(content) {
2199
+ cleanup();
2200
+ create();
2201
+ return Teabag.fixture.el.innerHTML = content;
2202
+ };
2203
+
2204
+ addContent = function(content) {
2205
+ if (!Teabag.fixture.el) {
2206
+ create();
2207
+ }
2208
+ return Teabag.fixture.el.innerHTML += content;
2209
+ };
2210
+
2211
+ create = function() {
2212
+ var _ref;
2213
+ Teabag.fixture.el = document.createElement("div");
2214
+ Teabag.fixture.el.id = "teabag-fixtures";
2215
+ return (_ref = document.body) != null ? _ref.appendChild(Teabag.fixture.el) : void 0;
2216
+ };
2217
+
2218
+ cleanup = function() {
2219
+ var _base, _ref, _ref1;
2220
+ (_base = Teabag.fixture).el || (_base.el = document.getElementById("teabag-fixtures"));
2221
+ if ((_ref = Teabag.fixture.el) != null) {
2222
+ if ((_ref1 = _ref.parentNode) != null) {
2223
+ _ref1.removeChild(Teabag.fixture.el);
2224
+ }
2225
+ }
2226
+ return Teabag.fixture.el = null;
2227
+ };
2228
+
2229
+ xhrRequest = function(url, callback) {
2230
+ if (window.XMLHttpRequest) {
2231
+ xhr = new XMLHttpRequest();
2232
+ } else if (window.ActiveXObject) {
2233
+ try {
2234
+ xhr = new ActiveXObject("Msxml2.XMLHTTP");
2235
+ } catch (e) {
2236
+ try {
2237
+ xhr = new ActiveXObject("Microsoft.XMLHTTP");
2238
+ } catch (e) {
2239
+
2240
+ }
2241
+ }
2242
+ }
2243
+ if (!xhr) {
2244
+ throw "Unable to make Ajax Request";
2245
+ }
2246
+ xhr.onreadystatechange = callback;
2247
+ xhr.open("GET", "" + Teabag.root + "/fixtures/" + url, false);
2248
+ return xhr.send();
2249
+ };
2250
+
2251
+ return fixture;
2252
+
2253
+ }).call(this);
2254
+
2075
2255
  }).call(this);
2076
2256
  (function() {
2077
2257
 
@@ -2941,20 +3121,14 @@
2941
3121
 
2942
3122
  }).call(this);
2943
3123
  (function() {
2944
- var __hasProp = {}.hasOwnProperty,
3124
+ var env, originalReset,
3125
+ __hasProp = {}.hasOwnProperty,
2945
3126
  __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; };
2946
3127
 
2947
3128
  Teabag.Runner = (function(_super) {
2948
- var env;
2949
3129
 
2950
3130
  __extends(Runner, _super);
2951
3131
 
2952
- env = QUnit;
2953
-
2954
- env.config.autostart = false;
2955
-
2956
- env.config.altertitle = false;
2957
-
2958
3132
  function Runner() {
2959
3133
  Runner.__super__.constructor.apply(this, arguments);
2960
3134
  env.start();
@@ -2976,7 +3150,7 @@
2976
3150
  this.spec = spec;
2977
3151
  this.fullDescription = "" + this.spec.module + " " + this.spec.name;
2978
3152
  this.description = "" + this.spec.name + " (" + this.spec.failed + ", " + this.spec.passed + ", " + this.spec.total + ")";
2979
- this.link = "?grep=" + (encodeURIComponent(this.fullDescription));
3153
+ this.link = "?grep=" + (encodeURIComponent("" + this.spec.module + ": " + this.spec.name));
2980
3154
  this.parent = this.spec.module ? new Teabag.Suite({
2981
3155
  description: this.spec.module
2982
3156
  }) : null;
@@ -3042,4 +3216,21 @@
3042
3216
 
3043
3217
  })();
3044
3218
 
3219
+ env = QUnit;
3220
+
3221
+ env.config.autostart = false;
3222
+
3223
+ env.config.altertitle = false;
3224
+
3225
+ env.config.filter = Teabag.Runner.prototype.getParams()["grep"];
3226
+
3227
+ window.fixture = Teabag.fixture;
3228
+
3229
+ originalReset = env.reset;
3230
+
3231
+ env.reset = function() {
3232
+ originalReset();
3233
+ return Teabag.fixture.cleanup();
3234
+ };
3235
+
3045
3236
  }).call(this);
@@ -339,6 +339,7 @@ body.teabag-passed #teabag-progress .teabag-indicator {
339
339
  top: 0;
340
340
  left: 0;
341
341
  width: 10000px;
342
+ opacity: 0;
342
343
  }
343
344
 
344
345
  /* Responsive
@@ -3,25 +3,24 @@
3
3
  <head>
4
4
  <title>Teabag :: Javascript Test Runner</title>
5
5
  <%= stylesheet_link_tag *@suite.stylesheets %>
6
- <%= javascript_include_tag_for_teabag *@suite.javascripts %>
7
6
  <%= csrf_meta_tags %>
8
7
  <meta name="viewport" content="width=device-width, user-scalable=no">
8
+ <%= javascript_include_tag_for_teabag *@suite.core_javascripts %>
9
9
  <script type="text/javascript">
10
+ // pass relevant info to javascript
11
+ Teabag.version = <%=raw Teabag::VERSION.inspect %>;
12
+ Teabag.root = <%=raw Teabag.configuration.mount_at.inspect %>;
13
+ Teabag.suites = <%=raw @suite.suites.to_json %>;
14
+
15
+ // start the execution of the specs (on onload, handling existing onload events)
10
16
  window.originalOnload = window.onload;
11
17
  window.onload = function() {
12
18
  if (window.originalOnload) window.originalOnload();
13
-
14
- // pass relevant info to javascript
15
- Teabag.version = <%=raw Teabag::VERSION.inspect %>;
16
- Teabag.root = <%=raw Teabag.configuration.mount_at.inspect %>;
17
- Teabag.suites = <%=raw @suite.suites.to_json %>;
18
-
19
- // start the execution of the specs
20
19
  Teabag.execute();
21
20
  }
22
21
  </script>
22
+ <%= javascript_include_tag_for_teabag *@suite.spec_javascripts %>
23
23
  </head>
24
24
  <body>
25
- <div id="teabag-fixtures"></div>
26
25
  </body>
27
26
  </html>
@@ -1,49 +1,47 @@
1
1
  Teabag.setup do |config|
2
2
 
3
- # This determines where the Teabag spec path will be mounted. Changing this to `"/jasmine"` would allow you to browse
4
- # to `http://localhost:3000/jasmine` to run your specs.
3
+ # This determines where the Teabag routes will be mounted. Changing this to "/jasmine" would allow you to browse to
4
+ # http://localhost:3000/jasmine to run your specs.
5
5
  config.mount_at = "/teabag"
6
6
 
7
- # The root path defaults to Rails.root if left nil, but if you're testing an engine using a dummy application it's
8
- # useful to be able to set this to your engines root.. E.g. `Teabag::Engine.root`
7
+ # This defaults to Rails.root if left nil. If you're testing an engine using a dummy application it can be useful to
8
+ # set this to your engines root.. E.g. `Teabag::Engine.root`
9
9
  config.root = nil
10
10
 
11
- # These paths are appended to the rails assets paths (relative to config.root), and by default is an array that you
11
+ # These paths are appended to the Rails assets paths (relative to config.root), and by default is an array that you
12
12
  # can replace or add to.
13
- config.asset_paths = ["spec/javascripts", "spec/javascripts/stylesheets"]
13
+ config.asset_paths = ["spec/javascripts", "spec/javascripts/stylesheets", "test/javascripts", "test/javascripts/stylesheets"]
14
14
 
15
- # Fixtures are different than the specs, in that Rails is rendering them directly through a controller. This means you
16
- # can use haml, erb builder, rabl, etc. to render content in the views available in this path.
15
+ # Fixtures are rendered through a standard controller. This means you can use things like HAML or RABL/JBuilder, etc.
16
+ # to generate fixtures within this path.
17
17
  config.fixture_path = "spec/javascripts/fixtures"
18
18
 
19
- # You can modify the default suite configuration or create new suites here. Suites can be entirely isolated from one
20
- # another. When defining a suite you can provide a name and a block. If the name is left blank, :default is assumed.
21
- # When defining suites, you can omit various directives and the defaults will be used.
19
+ # You can modify the default suite configuration and create new suites here. Suites can be isolated from one another.
20
+ # When defining a suite you can provide a name and a block. If the name is left blank, :default is assumed. You can
21
+ # omit various directives and the defaults will be used.
22
22
  #
23
23
  # To run a specific suite
24
24
  # - in the browser: http://localhost/teabag/[suite_name]
25
25
  # - from the command line: rake teabag suite=[suite_name]
26
26
  config.suite do |suite|
27
27
 
28
- # You can specify a file matcher for your specs and the matching files will be automatically loaded when the suite
29
- # is run. It's important that these files are serve-able from sprockets (aka the asset pipeline).
28
+ # You can specify a file matcher and all matching files will be loaded when the suite is run. It's important that
29
+ # these files are serve-able from sprockets.
30
30
  #
31
- # Note: set to nil if you want to load your spec files using a manifest from within the spec helper file.
31
+ # Note: Can also be set to nil.
32
32
  suite.matcher = "{spec/javascripts,app/assets}/**/*_spec.{js,js.coffee,coffee}"
33
33
 
34
- # Each suite can load a different spec helper, which can in turn require additional files since this file is also
35
- # served via the asset pipeline. This file is loaded before your specs are loaded -- so could potentially include
36
- # all of your specs (if you set the matcher to nil).
34
+ # Each suite can load a different spec helper, which can in turn require additional files. This file is loaded
35
+ # before your specs are loaded, and can be used as a manifest.
37
36
  suite.helper = "spec_helper"
38
37
 
39
- # These are the core Teabag javascripts. Spec files should not go here -- but if you want to add additional support
40
- # for jasmine matchers, switch to mocha, include expectation libraries etc., this is a good place to do that.
38
+ # These are the core Teabag javascripts. It's strongly encouraged to include only the base files here. You can
39
+ # require other support libraries in your spec helper, which allows you to change them without having to restart the
40
+ # server.
41
41
  #
42
- # To use mocha:
43
- # "teabag-mocha"
42
+ # Available frameworks: teabag-jasmine, teabag-mocha, teabag-qunit
44
43
  #
45
- # To use the coffeescript source files:
46
- # "teabag/jasmine" or "teabag/mocha"
44
+ # Note: To use the CoffeeScript source files use `"teabag/jasmine"` etc.
47
45
  suite.javascripts = ["teabag-jasmine"]
48
46
 
49
47
  # If you want to change how Teabag looks, or include your own stylesheets you can do that here. The default is the
@@ -57,12 +55,12 @@ Teabag.setup do |config|
57
55
  # suite.matcher = "spec/javascripts/targeted/*_spec.{js,js.coffee,coffee}"
58
56
  #end
59
57
 
60
- # When Teabag is run from the rake task these configuration directives apply.
58
+ # When Teabag is run via the rake task these configuration directives apply.
61
59
  #
62
- #config.driver = "phantomjs" # or selenium
63
- #config.formatters = "dot" # or tap_y, swayze_or_oprah
64
60
  #config.server_timeout = 20 # timeout for starting the server
65
- #config.fail_fast = true # allow continuing running suites after one has failed
66
- #config.suppress_log = false # suppress logs coming from console.[log/error/debug]
61
+ #config.driver = "phantomjs" # available: phantomjs, selenium
62
+ #config.formatters = "dot" # available: dot, tap_y, swayze_or_oprah
63
+ #config.fail_fast = true # stop running suites after one has failures
64
+ #config.suppress_log = false # suppress logs coming from console[log/error/debug]
67
65
 
68
66
  end if defined?(Teabag) && Teabag.respond_to?(:setup) # let Teabag be undefined outside of development/test/asset groups
data/lib/teabag/suite.rb CHANGED
@@ -10,7 +10,15 @@ module Teabag
10
10
  end
11
11
 
12
12
  def javascripts
13
- [config.javascripts, helper, specs].flatten
13
+ [core_javascripts, spec_javascripts].flatten
14
+ end
15
+
16
+ def core_javascripts
17
+ config.javascripts
18
+ end
19
+
20
+ def spec_javascripts
21
+ [helper, specs].flatten
14
22
  end
15
23
 
16
24
  def specs
@@ -1,3 +1,3 @@
1
1
  module Teabag
2
- VERSION = "0.4.2"
2
+ VERSION = "0.4.3"
3
3
  end