teabag 0.5.1 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (188) hide show
  1. data/app/assets/javascripts/teabag-jasmine.js +30 -15
  2. data/app/assets/javascripts/teabag-mocha.js +30 -14
  3. data/app/assets/javascripts/teabag-qunit.js +31 -15
  4. data/app/assets/javascripts/teabag-teabag.js +53 -0
  5. data/app/assets/javascripts/teabag/base/reporters/html.coffee +23 -49
  6. data/app/assets/javascripts/teabag/base/reporters/html/template.coffee +41 -0
  7. data/app/assets/javascripts/teabag/base/runner.coffee +1 -1
  8. data/app/assets/javascripts/teabag/jasmine.coffee +0 -1
  9. data/app/assets/javascripts/teabag/mocha.coffee +0 -1
  10. data/app/assets/javascripts/teabag/mocha/reporters/html.coffee +0 -1
  11. data/app/assets/javascripts/teabag/qunit.coffee +1 -2
  12. data/app/assets/javascripts/teabag/teabag.coffee +32 -0
  13. data/app/assets/stylesheets/teabag.css +94 -26
  14. data/app/controllers/teabag/spec_controller.rb +5 -1
  15. data/app/views/teabag/spec/{index.html.erb → runner.html.erb} +0 -0
  16. data/app/views/teabag/spec/suites.html.erb +40 -0
  17. data/config/routes.rb +3 -2
  18. data/lib/teabag/console.rb +2 -2
  19. data/lib/teabag/drivers/phantomjs/runner.coffee +1 -0
  20. data/lib/teabag/suite.rb +26 -16
  21. data/lib/teabag/version.rb +1 -1
  22. data/spec/dummy/app/assets/javascripts/integration/integration_spec.coffee +1 -1
  23. data/spec/dummy/config/application.rb +1 -27
  24. data/spec/dummy/config/boot.rb +5 -8
  25. data/spec/dummy/config/routes.rb +0 -1
  26. data/spec/dummy/log/development.log +67702 -0
  27. data/spec/dummy/log/test.log +1488 -0
  28. data/spec/dummy/tmp/cache/assets/BE1/2F0/sprockets%2F5d1a10a753437053978b5661a7513600 +0 -0
  29. data/spec/dummy/tmp/cache/assets/C13/B50/sprockets%2F431452d41e5087d2211162d23c63789b +0 -0
  30. data/spec/dummy/tmp/cache/assets/C35/A30/sprockets%2F29906bf540f7d2e081088494b2554989 +0 -0
  31. data/spec/dummy/tmp/cache/assets/C4E/9B0/sprockets%2Fa807397434c9262c3d62da3e91152184 +0 -0
  32. data/spec/dummy/tmp/cache/assets/C59/250/sprockets%2Fa80d3fe493d2476e58c4323996064512 +0 -0
  33. data/spec/dummy/tmp/cache/assets/C72/150/sprockets%2F4194031b4b51b6422c14ac697e3455e5 +0 -0
  34. data/spec/dummy/tmp/cache/assets/C75/D50/sprockets%2F5302968a40e08d2c011aa38666d273f6 +0 -0
  35. data/spec/dummy/tmp/cache/assets/C78/F80/sprockets%2F9161622ddd251097a4ab816b8220984c +0 -0
  36. data/spec/dummy/tmp/cache/assets/C7A/EC0/sprockets%2F5c16e4214f5662e1b27932a57c43491b +0 -0
  37. data/spec/dummy/tmp/cache/assets/C83/E90/sprockets%2F8be0bf09618c38257464f07790a4163b +0 -0
  38. data/spec/dummy/tmp/cache/assets/C89/700/sprockets%2F259935a7704fef0069303ea63fa89408 +0 -0
  39. data/spec/dummy/tmp/cache/assets/C8A/460/sprockets%2F77bffd9959420103906722b404ae8d59 +0 -0
  40. data/spec/dummy/tmp/cache/assets/C91/FA0/sprockets%2F2eb81283f5789ae91a69344552db3856 +0 -0
  41. data/spec/dummy/tmp/cache/assets/C9D/E90/sprockets%2F3045c9533f179d3e1c805d163ed002a0 +0 -0
  42. data/spec/dummy/tmp/cache/assets/CA6/2F0/sprockets%2F20040c18b672e4c4d2731a2a929d8b97 +0 -0
  43. data/spec/dummy/tmp/cache/assets/CA6/DF0/sprockets%2F7da83747ce56e49393b6b8726587f846 +0 -0
  44. data/spec/dummy/tmp/cache/assets/CA9/C40/sprockets%2F932b7e2cd1e067289ab51190800814df +0 -0
  45. data/spec/dummy/tmp/cache/assets/CAA/0C0/sprockets%2F057b0ce384f16d9202ae84473436cc35 +0 -0
  46. data/spec/dummy/tmp/cache/assets/CAD/410/sprockets%2F651414e5c7e86f05c5108dc71626b25c +0 -0
  47. data/spec/dummy/tmp/cache/assets/CAF/0F0/sprockets%2F6000e67cf3f2377f860c24da7c819701 +0 -0
  48. data/spec/dummy/tmp/cache/assets/CB0/700/sprockets%2F006af6bf0f6b55777b03c4615c853881 +0 -0
  49. data/spec/dummy/tmp/cache/assets/CB5/E60/sprockets%2Ff0f2b623b42840839e37f5ed055f5482 +0 -0
  50. data/spec/dummy/tmp/cache/assets/CBB/FA0/sprockets%2F74922109263bdc965b2e9567eec6d154 +0 -0
  51. data/spec/dummy/tmp/cache/assets/CBD/AF0/sprockets%2Fd687ec33822256e9444e8cd04f1b4873 +0 -0
  52. data/spec/dummy/tmp/cache/assets/CBF/630/sprockets%2F707d2db81468088470d476abff35388d +0 -0
  53. data/spec/dummy/tmp/cache/assets/CC2/EC0/sprockets%2F76bf80cb571ca530357f78db78167866 +0 -0
  54. data/spec/dummy/tmp/cache/assets/CC3/BA0/sprockets%2Fa717665e3657e376fa8d788940d6a22a +0 -0
  55. data/spec/dummy/tmp/cache/assets/CCC/DB0/sprockets%2F3998958d61cda73452466f5652ed81ef +0 -0
  56. data/spec/dummy/tmp/cache/assets/CCE/C50/sprockets%2Fe12774c2fea852112414bb379a71f31a +0 -0
  57. data/spec/dummy/tmp/cache/assets/CD1/620/sprockets%2F06a3eb05fcb4175a679d6084a06026a6 +0 -0
  58. data/spec/dummy/tmp/cache/assets/CD3/460/sprockets%2F7f3f6802b0b309ed142d0b671c9640c4 +0 -0
  59. data/spec/dummy/tmp/cache/assets/CD6/DD0/sprockets%2F301bd3b0e19eb866905681d03a891be3 +0 -0
  60. data/spec/dummy/tmp/cache/assets/CD9/9B0/sprockets%2Fdc1f0447e4c5c2f990750b2f722c5900 +0 -0
  61. data/spec/dummy/tmp/cache/assets/CD9/DD0/sprockets%2Fe5774759168a731da1c1149ecf0e1b03 +0 -0
  62. data/spec/dummy/tmp/cache/assets/CE0/090/sprockets%2F48d5d35ae87d0723318b8bc257fa2237 +0 -0
  63. data/spec/dummy/tmp/cache/assets/CE3/1F0/sprockets%2Fe69a515d3a9d14c669be8871012a7d07 +0 -0
  64. data/spec/dummy/tmp/cache/assets/CE4/190/sprockets%2F36c9ee4181433e33e07eb9748d218ae2 +0 -0
  65. data/spec/dummy/tmp/cache/assets/CE6/270/sprockets%2F2c98152560d18470fec8cf4c6829b4d0 +0 -0
  66. data/spec/dummy/tmp/cache/assets/CE6/7C0/sprockets%2Fa03a2c86ce6724be8542295e1cf24798 +0 -0
  67. data/spec/dummy/tmp/cache/assets/CE7/A60/sprockets%2Ff58eee249aa167d23f8220087bb46684 +0 -0
  68. data/spec/dummy/tmp/cache/assets/CE9/9E0/sprockets%2F135480d497ed7e4884462dc0ef0b80d7 +0 -0
  69. data/spec/dummy/tmp/cache/assets/CEB/090/sprockets%2F55dcd7ace406b77208c380d496e37864 +0 -0
  70. data/spec/dummy/tmp/cache/assets/CEB/680/sprockets%2F67f0794ef8c0576d5c7da34f4437305a +0 -0
  71. data/spec/dummy/tmp/cache/assets/CEB/B40/sprockets%2F1150bf8d912aa100a132251eefaf6045 +0 -0
  72. data/spec/dummy/tmp/cache/assets/CF1/C50/sprockets%2F57bd9ac92067ea01882feef075582758 +0 -0
  73. data/spec/dummy/tmp/cache/assets/CF3/3A0/sprockets%2F6571249b82eb52e7c7e035c692df9b69 +0 -0
  74. data/spec/dummy/tmp/cache/assets/CF4/6C0/sprockets%2F087d4a99adae6d6972937a2e57e93504 +0 -0
  75. data/spec/dummy/tmp/cache/assets/CF4/6F0/sprockets%2Fed96f92571224b862b84d7078b86ded3 +0 -0
  76. data/spec/dummy/tmp/cache/assets/CF7/F10/sprockets%2F8c45854ebd195b52cc42bf3f99996336 +0 -0
  77. data/spec/dummy/tmp/cache/assets/CF8/780/sprockets%2F8845b81ff27cdb57c835836c9f91a265 +0 -0
  78. data/spec/dummy/tmp/cache/assets/CFA/D20/sprockets%2Fb26796b39b3c5d6ed70be7989637a493 +0 -0
  79. data/spec/dummy/tmp/cache/assets/CFC/380/sprockets%2Fa7443cbd671446a589867dd5f4a4f989 +0 -0
  80. data/spec/dummy/tmp/cache/assets/D00/110/sprockets%2F6a6353b7723a8b21708e0fbfe04bd422 +0 -0
  81. data/spec/dummy/tmp/cache/assets/D00/F60/sprockets%2F42e279b52511c47d26c0adb125fd04e8 +0 -0
  82. data/spec/dummy/tmp/cache/assets/D03/630/sprockets%2F5d8da32dba6a7be70426a1d554773701 +0 -0
  83. data/spec/dummy/tmp/cache/assets/D04/170/sprockets%2F76ab1dc02e6c7618852708a1e05a2df3 +0 -0
  84. data/spec/dummy/tmp/cache/assets/D04/480/sprockets%2F8bd8f10500b21d2f9d94e4cd1401c936 +0 -0
  85. data/spec/dummy/tmp/cache/assets/D04/580/sprockets%2F18748d128c062c8eab0e22d35d41b19e +0 -0
  86. data/spec/dummy/tmp/cache/assets/D05/8D0/sprockets%2F319f8f235f452343f1ebf03cb262d23d +0 -0
  87. data/spec/dummy/tmp/cache/assets/D09/BF0/sprockets%2F9e6bca5d26f50d9484385d51ba04312c +0 -0
  88. data/spec/dummy/tmp/cache/assets/D0B/210/sprockets%2Fb95ce127097fba0e4019f633e91b730d +0 -0
  89. data/spec/dummy/tmp/cache/assets/D0E/570/sprockets%2F90fe371bf8091e88a712124d9cdae260 +0 -0
  90. data/spec/dummy/tmp/cache/assets/D15/750/sprockets%2F8effdd3e668a4036260a3e370f3b6657 +0 -0
  91. data/spec/dummy/tmp/cache/assets/D17/710/sprockets%2Ffa49fb6823d466e79a195e0cd71340c5 +0 -0
  92. data/spec/dummy/tmp/cache/assets/D1A/D30/sprockets%2F815a5177e9edba0c5c996182ef1b3675 +0 -0
  93. data/spec/dummy/tmp/cache/assets/D1B/730/sprockets%2Fcf6ce779d043d29aae915f599a413380 +0 -0
  94. data/spec/dummy/tmp/cache/assets/D1D/560/sprockets%2F1ca784ee7ba1922465147e7f8963eae5 +0 -0
  95. data/spec/dummy/tmp/cache/assets/D1E/AA0/sprockets%2F5c8741a556bc955cd36e61c88582b6dc +0 -0
  96. data/spec/dummy/tmp/cache/assets/D23/E70/sprockets%2F0c6d23a1282deab18acb51022a74489a +0 -0
  97. data/spec/dummy/tmp/cache/assets/D2D/060/sprockets%2F545ec7a363badb5e7106e5112b53b26d +0 -0
  98. data/spec/dummy/tmp/cache/assets/D2F/520/sprockets%2Fea2308e8add6880c1c4d47040ab710d7 +0 -0
  99. data/spec/dummy/tmp/cache/assets/D31/9C0/sprockets%2Fbd102a4f5a4985c3519dd6ab0295a1c6 +0 -0
  100. data/spec/dummy/tmp/cache/assets/D32/500/sprockets%2F6927df5a24d91c75d001e2b5600ab8be +0 -0
  101. data/spec/dummy/tmp/cache/assets/D35/7C0/sprockets%2Ff536a2606eaf7d542c0985104cb62baf +0 -0
  102. data/spec/dummy/tmp/cache/assets/D37/300/sprockets%2F2d0e503e6a7c7c7fdc9912501b2f6b43 +0 -0
  103. data/spec/dummy/tmp/cache/assets/D37/FF0/sprockets%2F96841ca4cfae32c515077f3f5fc303b2 +0 -0
  104. data/spec/dummy/tmp/cache/assets/D3C/840/sprockets%2Fc6202ec91d567a85bd3d46dc43ea9108 +0 -0
  105. data/spec/dummy/tmp/cache/assets/D44/E90/sprockets%2F05cfc0bf7c9938963d1d1c63248db80d +0 -0
  106. data/spec/dummy/tmp/cache/assets/D45/C30/sprockets%2Fcc744877558178a3adb77c441cadce70 +0 -0
  107. data/spec/dummy/tmp/cache/assets/D47/A90/sprockets%2Fe7ca382b607c595ea6505853f7fb63da +0 -0
  108. data/spec/dummy/tmp/cache/assets/D49/1F0/sprockets%2F773b56f87127c6605e7d1d3faf2b6af6 +0 -0
  109. data/spec/dummy/tmp/cache/assets/D49/A10/sprockets%2Fc4656bd995a6f297c26d19b13aadb963 +0 -0
  110. data/spec/dummy/tmp/cache/assets/D4A/580/sprockets%2F19b8d8a9a57850de79b6c099fb2d010e +0 -0
  111. data/spec/dummy/tmp/cache/assets/D50/D70/sprockets%2Fe2a3e6c95b11e0801a4eebae3a026026 +0 -0
  112. data/spec/dummy/tmp/cache/assets/D51/400/sprockets%2Ff5e433d8a31e80985b75ce598de236be +0 -0
  113. data/spec/dummy/tmp/cache/assets/D54/D80/sprockets%2F631327e25ec20edc723046cdec3bb1c0 +0 -0
  114. data/spec/dummy/tmp/cache/assets/D58/870/sprockets%2F3cef1ff075a050004b74ffa13c8c4f02 +0 -0
  115. data/spec/dummy/tmp/cache/assets/D5C/710/sprockets%2F9427d05cee2caa721241a25a9af1d08f +0 -0
  116. data/spec/dummy/tmp/cache/assets/D5C/CC0/sprockets%2Faa8bf6de211f2765b0a26f112b971f0c +0 -0
  117. data/spec/dummy/tmp/cache/assets/D5E/FA0/sprockets%2Fc81c371ae2d61a6aa1708262fba79e0d +0 -0
  118. data/spec/dummy/tmp/cache/assets/D61/1F0/sprockets%2F0c7a6176d2fc4db00bb9a74d36380fe1 +0 -0
  119. data/spec/dummy/tmp/cache/assets/D61/E60/sprockets%2F301aede3913de3c54c91b65cf2bd3381 +0 -0
  120. data/spec/dummy/tmp/cache/assets/D67/030/sprockets%2Fb8b36ba6104c8dbe6297b4e61e6d33b1 +0 -0
  121. data/spec/dummy/tmp/cache/assets/D67/BC0/sprockets%2F35d2c2b45981ade5a2db2a9c7f37a615 +0 -0
  122. data/spec/dummy/tmp/cache/assets/D67/C20/sprockets%2F0d30bf27e5f74bbd85f313cb8d3c4623 +0 -0
  123. data/spec/dummy/tmp/cache/assets/D69/F90/sprockets%2F6a0795b7b38bd7e6142cd1b88211dade +0 -0
  124. data/spec/dummy/tmp/cache/assets/D6A/7E0/sprockets%2F3a3b155b775b7d32b25abc8cb6bf9727 +0 -0
  125. data/spec/dummy/tmp/cache/assets/D6A/950/sprockets%2F429b1806cb7580ebf29f9a12c33cbea6 +0 -0
  126. data/spec/dummy/tmp/cache/assets/D6D/DA0/sprockets%2Fac936bf40b42227a2bf9d474ae9ec149 +0 -0
  127. data/spec/dummy/tmp/cache/assets/D6F/5B0/sprockets%2F5dcc801a7a6c340c5baf525839f9b8b6 +0 -0
  128. data/spec/dummy/tmp/cache/assets/D73/C00/sprockets%2F9cf4bfb486e4ab461e3f275a3d974c30 +0 -0
  129. data/spec/dummy/tmp/cache/assets/D77/B30/sprockets%2F946cf2f17c7eb41037f9ee08ad67ec40 +0 -0
  130. data/spec/dummy/tmp/cache/assets/D78/2F0/sprockets%2F3c61f8915b8f717b1de788e6ecad122c +0 -0
  131. data/spec/dummy/tmp/cache/assets/D78/870/sprockets%2F8f3a7d4fcd104fa8e47f552f6630a49e +0 -0
  132. data/spec/dummy/tmp/cache/assets/D78/F10/sprockets%2Fa2d995664d1a9bf976c1bfbbb90f8710 +0 -0
  133. data/spec/dummy/tmp/cache/assets/D79/B60/sprockets%2F5e6fb36a01166982ae9a59eced0a4f88 +0 -0
  134. data/spec/dummy/tmp/cache/assets/D7E/C10/sprockets%2F747c98c3cc7494a62dd882752adffb2b +0 -0
  135. data/spec/dummy/tmp/cache/assets/D80/390/sprockets%2Fe44158f578d9ffade083a07f54eab729 +0 -0
  136. data/spec/dummy/tmp/cache/assets/D93/BD0/sprockets%2Ff5e1b60201e08e3ddf8d3de5211f3d5e +0 -0
  137. data/spec/dummy/tmp/cache/assets/D9A/540/sprockets%2F60ad172ea82631ca9c666cfd4d95f1ab +0 -0
  138. data/spec/dummy/tmp/cache/assets/DA0/330/sprockets%2Fcbbb4de706387d50f48a72ee6c9c1b80 +0 -0
  139. data/spec/dummy/tmp/cache/assets/DA5/0A0/sprockets%2F7a4b5928cec69ab65afff309a04d6b47 +0 -0
  140. data/spec/dummy/tmp/cache/assets/DA8/C50/sprockets%2F0810627fddce930a399fc60d3be97fed +0 -0
  141. data/spec/dummy/tmp/cache/assets/DA9/BF0/sprockets%2Fc59f8f7bf494fe030610bc86bb7cc5e5 +0 -0
  142. data/spec/dummy/tmp/cache/assets/DAD/1F0/sprockets%2Fdf7609630657aee0ebe5ed61e929d5dd +0 -0
  143. data/spec/dummy/tmp/cache/assets/DAE/6C0/sprockets%2F77c7a8676aeefa73156c55dfcf51cc46 +0 -0
  144. data/spec/dummy/tmp/cache/assets/DB3/5D0/sprockets%2Fce1d4d75832c9bdeafd869f6f7b61725 +0 -0
  145. data/spec/dummy/tmp/cache/assets/DB3/D70/sprockets%2Fcc2f5e1f6eeb99c33881848cb1cde758 +0 -0
  146. data/spec/dummy/tmp/cache/assets/DB5/040/sprockets%2F9a9da5df88713663b9fbc945facca891 +0 -0
  147. data/spec/dummy/tmp/cache/assets/DB9/220/sprockets%2Fd2dc4f59e70e73984997ffca8ad7f4a0 +0 -0
  148. data/spec/dummy/tmp/cache/assets/DBC/A20/sprockets%2Fec46fb30cecc002128c61fb49cf30da8 +0 -0
  149. data/spec/dummy/tmp/cache/assets/DC4/860/sprockets%2Fa01a3cf460ff15daae0f928d0f85f52e +0 -0
  150. data/spec/dummy/tmp/cache/assets/DC4/CA0/sprockets%2Fdbcd5b5132f1ec3ff0e7e7db19190f03 +0 -0
  151. data/spec/dummy/tmp/cache/assets/DC7/A10/sprockets%2F84a8af0fcbf401864e1ae5bf092cba94 +0 -0
  152. data/spec/dummy/tmp/cache/assets/DD7/630/sprockets%2Ffa5eec4483c5be83deee04f5a5654a58 +0 -0
  153. data/spec/dummy/tmp/cache/assets/DDB/520/sprockets%2Faa365f7b98350c85b6acb09d5e9cbf9e +0 -0
  154. data/spec/dummy/tmp/cache/assets/DDD/A60/sprockets%2Fff948b6ffe44a3cc3d2d109a39f548fd +0 -0
  155. data/spec/dummy/tmp/cache/assets/DE4/140/sprockets%2F139e4ab85d1aacb22c115fa136afdc8a +0 -0
  156. data/spec/dummy/tmp/cache/assets/DF6/0E0/sprockets%2F85b10db6e1afe643aba6d396abdd77f0 +0 -0
  157. data/spec/dummy/tmp/cache/assets/DF7/E10/sprockets%2F25e4253aba9a9adcefb72552fb1ff0c8 +0 -0
  158. data/spec/dummy/tmp/cache/assets/DFC/C20/sprockets%2Fd9178ad7e3b401c9fceafd64ea2b50d6 +0 -0
  159. data/spec/dummy/tmp/cache/assets/DFC/C30/sprockets%2Fb50a07cb30b0bd0eec8e98e5de79d65d +0 -0
  160. data/spec/dummy/tmp/cache/assets/E02/6E0/sprockets%2F63d6a5cdb8cefa64ef76b5c6e0fd3720 +0 -0
  161. data/spec/dummy/tmp/cache/assets/E08/BB0/sprockets%2Fefac99af1af28543aef6fb607faa4973 +0 -0
  162. data/spec/dummy/tmp/cache/assets/E08/F20/sprockets%2F4fc5cdcd6974efe7adfe809b30bd6513 +0 -0
  163. data/spec/dummy/tmp/cache/assets/E0D/070/sprockets%2F0e7ef9a5978dcc6b1abce678ef836c0a +0 -0
  164. data/spec/dummy/tmp/cache/assets/E14/8E0/sprockets%2Fb8d902ffcf8758fde63d0fa579ba6d4e +0 -0
  165. data/spec/dummy/tmp/cache/assets/E16/D30/sprockets%2Fd69469e6e7439baacd8df989c0fdacc2 +0 -0
  166. data/spec/dummy/tmp/cache/assets/E2F/790/sprockets%2F7fac280deaa7ef20a77d5c9b5b9cfc34 +0 -0
  167. data/spec/dummy/tmp/cache/assets/E36/A40/sprockets%2Ff3477eebd69a4f1b8fbdd3f9ef2ba242 +0 -0
  168. data/spec/dummy/tmp/cache/assets/E41/250/sprockets%2F97cf8fe3d7ffaff076f655aefb36da03 +0 -0
  169. data/spec/dummy/tmp/cache/assets/E64/1E0/sprockets%2F81ab4c863fbbdec8dd66afc97ebf034d +0 -0
  170. data/spec/dummy/tmp/cache/assets/E6E/260/sprockets%2Fd9f8ab8b91ef582cc6c99a3ba0dedfe6 +0 -0
  171. data/spec/dummy/tmp/cache/assets/E89/4C0/sprockets%2F68b2eedb3cde6fc01d50fead7caf8a18 +0 -0
  172. data/spec/dummy/tmp/cache/assets/F79/360/sprockets%2F0ce035fefee5ebdabc8efabfbdbd6ee4 +0 -0
  173. data/spec/features/console_reporter_spec.rb +1 -0
  174. data/spec/javascripts/teabag/base/reporters/html/failure_view_spec.coffee +27 -0
  175. data/spec/javascripts/teabag/base/reporters/html_spec.coffee +25 -9
  176. data/spec/javascripts/teabag/base/runner_spec.coffee +2 -0
  177. data/spec/javascripts/teabag/jasmine/fixture_jspec.coffee +13 -0
  178. data/spec/javascripts/teabag/jasmine/runner_jspec.coffee +0 -7
  179. data/spec/javascripts/teabag/mocha/fixture_mspec.coffee +12 -0
  180. data/spec/javascripts/teabag/mocha/models_mspec.coffee +7 -9
  181. data/spec/javascripts/teabag/mocha/reporters/html_mspec.coffee +0 -4
  182. data/spec/teabag/console_spec.rb +3 -3
  183. data/spec/teabag/suite_spec.rb +45 -16
  184. data/test/javascripts/teabag/qunit/{qunit_test.coffee → fixture_test.coffee} +0 -33
  185. data/test/javascripts/teabag/qunit/runner_test.coffee +0 -2
  186. metadata +57 -11
  187. data/spec/javascripts/teabag/jasmine/jasmine_jspec.coffee +0 -60
  188. data/spec/javascripts/teabag/mocha/mocha_mspec.coffee +0 -60
@@ -2665,7 +2665,7 @@ jasmine.version_= {
2665
2665
  }
2666
2666
  this.constructor.run = true;
2667
2667
  this.fixturePath = "" + Teabag.root + "/fixtures";
2668
- this.params = this.getParams();
2668
+ this.params = Teabag.params = this.getParams();
2669
2669
  this.setup();
2670
2670
  }
2671
2671
 
@@ -2984,7 +2984,8 @@ jasmine.version_= {
2984
2984
  specs: {},
2985
2985
  suites: {}
2986
2986
  };
2987
- this.filter = false;
2987
+ this.filters = [];
2988
+ this.setFilters();
2988
2989
  this.readConfig();
2989
2990
  HTML.__super__.constructor.apply(this, arguments);
2990
2991
  }
@@ -2992,22 +2993,24 @@ jasmine.version_= {
2992
2993
  HTML.prototype.build = function() {
2993
2994
  var _ref;
2994
2995
  this.buildLayout();
2995
- this.el = this.findEl("report-all");
2996
2996
  this.setText("env-info", this.envInfo());
2997
2997
  this.setText("version", Teabag.version);
2998
2998
  this.findEl("toggles").onclick = this.toggleConfig;
2999
+ this.findEl("suites").innerHTML = this.buildSuiteSelect();
2999
3000
  if ((_ref = this.findEl("suite-select")) != null) {
3000
3001
  _ref.onchange = this.changeSuite;
3001
3002
  }
3003
+ this.el = this.findEl("report-all");
3002
3004
  this.showConfiguration();
3003
- return this.buildProgress();
3005
+ this.buildProgress();
3006
+ return this.buildFilters();
3004
3007
  };
3005
3008
 
3006
3009
  HTML.prototype.buildLayout = function() {
3007
3010
  var el;
3008
3011
  el = this.createEl("div");
3009
3012
  document.body.appendChild(el);
3010
- return el.innerHTML = "<div id=\"teabag-html-reporter\">\n <div class=\"teabag-clearfix\">\n <div id=\"teabag-title\">\n <h1>Teabag</h1>\n <ul>\n <li>version: <b id=\"teabag-version\"></b></li>\n <li id=\"teabag-env-info\"></li>\n </ul>\n </div>\n <div id=\"teabag-progress\"></div>\n <ul id=\"teabag-stats\">\n <li>passes: <b id=\"teabag-stats-passes\">0</b></li>\n <li>failures: <b id=\"teabag-stats-failures\">0</b></li>\n <li>skipped: <b id=\"teabag-stats-skipped\">0</b></li>\n <li>duration: <b id=\"teabag-stats-duration\">&infin;</b></li>\n </ul>\n </div>\n\n <div id=\"teabag-controls\" class=\"teabag-clearfix\">\n <div id=\"teabag-toggles\">\n <button id=\"teabag-use-catch\" title=\"Toggle using try/catch wrappers when possible\">Try/Catch</button>\n <button id=\"teabag-build-full-report\" title=\"Toggle building the full report\">Full Report</button>\n <button id=\"teabag-display-progress\" title=\"Toggle displaying progress as tests run\">Progress</button>\n </div>\n <div id=\"teabag-filter\">\n " + (this.buildSuiteSelect()) + "\n <button onclick=\"window.location.href = window.location.pathname\">Run All</button>\n <span id=\"teabag-filter-info\">\n </div>\n </div>\n\n <hr/>\n\n <div id=\"teabag-report\">\n <ol id=\"teabag-report-failures\"></ol>\n <ol id=\"teabag-report-all\"></ol>\n </div>\n</div>";
3013
+ return el.innerHTML = Teabag.Reporters.HTML.template;
3011
3014
  };
3012
3015
 
3013
3016
  HTML.prototype.buildSuiteSelect = function() {
@@ -3029,6 +3032,13 @@ jasmine.version_= {
3029
3032
  return this.progress.appendTo(this.findEl("progress"));
3030
3033
  };
3031
3034
 
3035
+ HTML.prototype.buildFilters = function() {
3036
+ if (this.filters.length) {
3037
+ this.setClass("filter", "teabag-filtered");
3038
+ }
3039
+ return this.setHtml("filter-list", "<li>" + (this.filters.join("</li><li>")) + "</li>", true);
3040
+ };
3041
+
3032
3042
  HTML.prototype.reportRunnerStarting = function(runner) {
3033
3043
  this.total.exist = runner.total || runner.specs().length;
3034
3044
  if (this.total.exist) {
@@ -3122,12 +3132,15 @@ jasmine.version_= {
3122
3132
  return document.body.className = "teabag-" + status;
3123
3133
  };
3124
3134
 
3125
- HTML.prototype.setFilter = function(filter) {
3126
- if (!filter) {
3127
- return;
3135
+ HTML.prototype.setFilters = function() {
3136
+ var link;
3137
+ link = [Teabag.root, Teabag.suites.active].join('/');
3138
+ if (Teabag.params["file"]) {
3139
+ this.filters.push("<a href='" + link + "'>remove</a> by file: " + Teabag.params["file"]);
3140
+ }
3141
+ if (Teabag.params["grep"]) {
3142
+ return this.filters.push("<a href='" + link + "'>remove</a> by match: " + Teabag.params["grep"]);
3128
3143
  }
3129
- this.setClass("filter", "teabag-filtered");
3130
- return this.setHtml("filter-info", "" + filter, true);
3131
3144
  };
3132
3145
 
3133
3146
  HTML.prototype.readConfig = function() {
@@ -3150,7 +3163,7 @@ jasmine.version_= {
3150
3163
  };
3151
3164
 
3152
3165
  HTML.prototype.changeSuite = function() {
3153
- return window.location.href = "/teabag/" + this.options[this.options.selectedIndex].value;
3166
+ return window.location.href = [Teabag.root, this.options[this.options.selectedIndex].value].join('/');
3154
3167
  };
3155
3168
 
3156
3169
  HTML.prototype.refresh = function() {
@@ -3169,7 +3182,7 @@ jasmine.version_= {
3169
3182
  } else {
3170
3183
  date = new Teabag.Date();
3171
3184
  date.setDate(date.getDate() + 365);
3172
- return document.cookie = "" + name + "=" + (escape(JSON.stringify(value))) + "; path=\"/\"; expires=" + (date.toUTCString()) + ";";
3185
+ return document.cookie = "" + name + "=" + (escape(JSON.stringify(value))) + "; expires=" + (date.toUTCString()) + "; path=/;";
3173
3186
  }
3174
3187
  };
3175
3188
 
@@ -3459,6 +3472,11 @@ jasmine.version_= {
3459
3472
 
3460
3473
  })(Teabag.Reporters.BaseView);
3461
3474
 
3475
+ }).call(this);
3476
+ (function() {
3477
+
3478
+ Teabag.Reporters.HTML.template = "<div id=\"teabag-interface\">\n <div class=\"teabag-clearfix\">\n <div id=\"teabag-title\">\n <h1>Teabag</h1>\n <ul>\n <li>version: <b id=\"teabag-version\"></b></li>\n <li id=\"teabag-env-info\"></li>\n </ul>\n </div>\n <div id=\"teabag-progress\"></div>\n <ul id=\"teabag-stats\">\n <li>passes: <b id=\"teabag-stats-passes\">0</b></li>\n <li>failures: <b id=\"teabag-stats-failures\">0</b></li>\n <li>skipped: <b id=\"teabag-stats-skipped\">0</b></li>\n <li>duration: <b id=\"teabag-stats-duration\">&infin;</b></li>\n </ul>\n </div>\n\n <div id=\"teabag-controls\" class=\"teabag-clearfix\">\n <div id=\"teabag-toggles\">\n <button id=\"teabag-use-catch\" title=\"Toggle using try/catch wrappers when possible\">Try/Catch</button>\n <button id=\"teabag-build-full-report\" title=\"Toggle building the full report\">Full Report</button>\n <button id=\"teabag-display-progress\" title=\"Toggle displaying progress as tests run\">Progress</button>\n </div>\n <div id=\"teabag-suites\"></div>\n </div>\n\n <hr/>\n\n <div id=\"teabag-filter\">\n <h1>Filtering</h1>\n <ul id=\"teabag-filter-list\"></ul>\n </div>\n\n <div id=\"teabag-report\">\n <ol id=\"teabag-report-failures\"></ol>\n <ol id=\"teabag-report-all\"></ol>\n </div>\n</div>";
3479
+
3462
3480
  }).call(this);
3463
3481
  (function() {
3464
3482
  var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
@@ -3628,9 +3646,6 @@ jasmine.version_= {
3628
3646
  };
3629
3647
  }
3630
3648
  reporter = new (this.getReporter())();
3631
- if (typeof reporter.setFilter === "function") {
3632
- reporter.setFilter(this.params["grep"]);
3633
- }
3634
3649
  env.addReporter(reporter);
3635
3650
  return this.addFixtureSupport();
3636
3651
  };
@@ -5076,7 +5076,7 @@
5076
5076
  }
5077
5077
  this.constructor.run = true;
5078
5078
  this.fixturePath = "" + Teabag.root + "/fixtures";
5079
- this.params = this.getParams();
5079
+ this.params = Teabag.params = this.getParams();
5080
5080
  this.setup();
5081
5081
  }
5082
5082
 
@@ -5395,7 +5395,8 @@
5395
5395
  specs: {},
5396
5396
  suites: {}
5397
5397
  };
5398
- this.filter = false;
5398
+ this.filters = [];
5399
+ this.setFilters();
5399
5400
  this.readConfig();
5400
5401
  HTML.__super__.constructor.apply(this, arguments);
5401
5402
  }
@@ -5403,22 +5404,24 @@
5403
5404
  HTML.prototype.build = function() {
5404
5405
  var _ref;
5405
5406
  this.buildLayout();
5406
- this.el = this.findEl("report-all");
5407
5407
  this.setText("env-info", this.envInfo());
5408
5408
  this.setText("version", Teabag.version);
5409
5409
  this.findEl("toggles").onclick = this.toggleConfig;
5410
+ this.findEl("suites").innerHTML = this.buildSuiteSelect();
5410
5411
  if ((_ref = this.findEl("suite-select")) != null) {
5411
5412
  _ref.onchange = this.changeSuite;
5412
5413
  }
5414
+ this.el = this.findEl("report-all");
5413
5415
  this.showConfiguration();
5414
- return this.buildProgress();
5416
+ this.buildProgress();
5417
+ return this.buildFilters();
5415
5418
  };
5416
5419
 
5417
5420
  HTML.prototype.buildLayout = function() {
5418
5421
  var el;
5419
5422
  el = this.createEl("div");
5420
5423
  document.body.appendChild(el);
5421
- return el.innerHTML = "<div id=\"teabag-html-reporter\">\n <div class=\"teabag-clearfix\">\n <div id=\"teabag-title\">\n <h1>Teabag</h1>\n <ul>\n <li>version: <b id=\"teabag-version\"></b></li>\n <li id=\"teabag-env-info\"></li>\n </ul>\n </div>\n <div id=\"teabag-progress\"></div>\n <ul id=\"teabag-stats\">\n <li>passes: <b id=\"teabag-stats-passes\">0</b></li>\n <li>failures: <b id=\"teabag-stats-failures\">0</b></li>\n <li>skipped: <b id=\"teabag-stats-skipped\">0</b></li>\n <li>duration: <b id=\"teabag-stats-duration\">&infin;</b></li>\n </ul>\n </div>\n\n <div id=\"teabag-controls\" class=\"teabag-clearfix\">\n <div id=\"teabag-toggles\">\n <button id=\"teabag-use-catch\" title=\"Toggle using try/catch wrappers when possible\">Try/Catch</button>\n <button id=\"teabag-build-full-report\" title=\"Toggle building the full report\">Full Report</button>\n <button id=\"teabag-display-progress\" title=\"Toggle displaying progress as tests run\">Progress</button>\n </div>\n <div id=\"teabag-filter\">\n " + (this.buildSuiteSelect()) + "\n <button onclick=\"window.location.href = window.location.pathname\">Run All</button>\n <span id=\"teabag-filter-info\">\n </div>\n </div>\n\n <hr/>\n\n <div id=\"teabag-report\">\n <ol id=\"teabag-report-failures\"></ol>\n <ol id=\"teabag-report-all\"></ol>\n </div>\n</div>";
5424
+ return el.innerHTML = Teabag.Reporters.HTML.template;
5422
5425
  };
5423
5426
 
5424
5427
  HTML.prototype.buildSuiteSelect = function() {
@@ -5440,6 +5443,13 @@
5440
5443
  return this.progress.appendTo(this.findEl("progress"));
5441
5444
  };
5442
5445
 
5446
+ HTML.prototype.buildFilters = function() {
5447
+ if (this.filters.length) {
5448
+ this.setClass("filter", "teabag-filtered");
5449
+ }
5450
+ return this.setHtml("filter-list", "<li>" + (this.filters.join("</li><li>")) + "</li>", true);
5451
+ };
5452
+
5443
5453
  HTML.prototype.reportRunnerStarting = function(runner) {
5444
5454
  this.total.exist = runner.total || runner.specs().length;
5445
5455
  if (this.total.exist) {
@@ -5533,12 +5543,15 @@
5533
5543
  return document.body.className = "teabag-" + status;
5534
5544
  };
5535
5545
 
5536
- HTML.prototype.setFilter = function(filter) {
5537
- if (!filter) {
5538
- return;
5546
+ HTML.prototype.setFilters = function() {
5547
+ var link;
5548
+ link = [Teabag.root, Teabag.suites.active].join('/');
5549
+ if (Teabag.params["file"]) {
5550
+ this.filters.push("<a href='" + link + "'>remove</a> by file: " + Teabag.params["file"]);
5551
+ }
5552
+ if (Teabag.params["grep"]) {
5553
+ return this.filters.push("<a href='" + link + "'>remove</a> by match: " + Teabag.params["grep"]);
5539
5554
  }
5540
- this.setClass("filter", "teabag-filtered");
5541
- return this.setHtml("filter-info", "" + filter, true);
5542
5555
  };
5543
5556
 
5544
5557
  HTML.prototype.readConfig = function() {
@@ -5561,7 +5574,7 @@
5561
5574
  };
5562
5575
 
5563
5576
  HTML.prototype.changeSuite = function() {
5564
- return window.location.href = "/teabag/" + this.options[this.options.selectedIndex].value;
5577
+ return window.location.href = [Teabag.root, this.options[this.options.selectedIndex].value].join('/');
5565
5578
  };
5566
5579
 
5567
5580
  HTML.prototype.refresh = function() {
@@ -5580,7 +5593,7 @@
5580
5593
  } else {
5581
5594
  date = new Teabag.Date();
5582
5595
  date.setDate(date.getDate() + 365);
5583
- return document.cookie = "" + name + "=" + (escape(JSON.stringify(value))) + "; path=\"/\"; expires=" + (date.toUTCString()) + ";";
5596
+ return document.cookie = "" + name + "=" + (escape(JSON.stringify(value))) + "; expires=" + (date.toUTCString()) + "; path=/;";
5584
5597
  }
5585
5598
  };
5586
5599
 
@@ -5870,6 +5883,11 @@
5870
5883
 
5871
5884
  })(Teabag.Reporters.BaseView);
5872
5885
 
5886
+ }).call(this);
5887
+ (function() {
5888
+
5889
+ Teabag.Reporters.HTML.template = "<div id=\"teabag-interface\">\n <div class=\"teabag-clearfix\">\n <div id=\"teabag-title\">\n <h1>Teabag</h1>\n <ul>\n <li>version: <b id=\"teabag-version\"></b></li>\n <li id=\"teabag-env-info\"></li>\n </ul>\n </div>\n <div id=\"teabag-progress\"></div>\n <ul id=\"teabag-stats\">\n <li>passes: <b id=\"teabag-stats-passes\">0</b></li>\n <li>failures: <b id=\"teabag-stats-failures\">0</b></li>\n <li>skipped: <b id=\"teabag-stats-skipped\">0</b></li>\n <li>duration: <b id=\"teabag-stats-duration\">&infin;</b></li>\n </ul>\n </div>\n\n <div id=\"teabag-controls\" class=\"teabag-clearfix\">\n <div id=\"teabag-toggles\">\n <button id=\"teabag-use-catch\" title=\"Toggle using try/catch wrappers when possible\">Try/Catch</button>\n <button id=\"teabag-build-full-report\" title=\"Toggle building the full report\">Full Report</button>\n <button id=\"teabag-display-progress\" title=\"Toggle displaying progress as tests run\">Progress</button>\n </div>\n <div id=\"teabag-suites\"></div>\n </div>\n\n <hr/>\n\n <div id=\"teabag-filter\">\n <h1>Filtering</h1>\n <ul id=\"teabag-filter-list\"></ul>\n </div>\n\n <div id=\"teabag-report\">\n <ol id=\"teabag-report-failures\"></ol>\n <ol id=\"teabag-report-all\"></ol>\n </div>\n</div>";
5890
+
5873
5891
  }).call(this);
5874
5892
  (function() {
5875
5893
  var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
@@ -6030,7 +6048,6 @@
6030
6048
  function HTML(runner) {
6031
6049
  this.reportSpecResults = __bind(this.reportSpecResults, this);
6032
6050
  HTML.__super__.constructor.apply(this, arguments);
6033
- this.setFilter(Teabag.Reporters.HTML.filter);
6034
6051
  this.reportRunnerStarting(runner);
6035
6052
  runner.on("fail", this.reportSpecResults);
6036
6053
  runner.on("test end", this.reportSpecResults);
@@ -6092,7 +6109,6 @@
6092
6109
  Runner.prototype.setup = function() {
6093
6110
  var reporter;
6094
6111
  reporter = this.getReporter();
6095
- reporter.filter = this.params["grep"];
6096
6112
  return env.setup({
6097
6113
  reporter: reporter
6098
6114
  });
@@ -2041,7 +2041,7 @@
2041
2041
  }
2042
2042
  this.constructor.run = true;
2043
2043
  this.fixturePath = "" + Teabag.root + "/fixtures";
2044
- this.params = this.getParams();
2044
+ this.params = Teabag.params = this.getParams();
2045
2045
  this.setup();
2046
2046
  }
2047
2047
 
@@ -2360,7 +2360,8 @@
2360
2360
  specs: {},
2361
2361
  suites: {}
2362
2362
  };
2363
- this.filter = false;
2363
+ this.filters = [];
2364
+ this.setFilters();
2364
2365
  this.readConfig();
2365
2366
  HTML.__super__.constructor.apply(this, arguments);
2366
2367
  }
@@ -2368,22 +2369,24 @@
2368
2369
  HTML.prototype.build = function() {
2369
2370
  var _ref;
2370
2371
  this.buildLayout();
2371
- this.el = this.findEl("report-all");
2372
2372
  this.setText("env-info", this.envInfo());
2373
2373
  this.setText("version", Teabag.version);
2374
2374
  this.findEl("toggles").onclick = this.toggleConfig;
2375
+ this.findEl("suites").innerHTML = this.buildSuiteSelect();
2375
2376
  if ((_ref = this.findEl("suite-select")) != null) {
2376
2377
  _ref.onchange = this.changeSuite;
2377
2378
  }
2379
+ this.el = this.findEl("report-all");
2378
2380
  this.showConfiguration();
2379
- return this.buildProgress();
2381
+ this.buildProgress();
2382
+ return this.buildFilters();
2380
2383
  };
2381
2384
 
2382
2385
  HTML.prototype.buildLayout = function() {
2383
2386
  var el;
2384
2387
  el = this.createEl("div");
2385
2388
  document.body.appendChild(el);
2386
- return el.innerHTML = "<div id=\"teabag-html-reporter\">\n <div class=\"teabag-clearfix\">\n <div id=\"teabag-title\">\n <h1>Teabag</h1>\n <ul>\n <li>version: <b id=\"teabag-version\"></b></li>\n <li id=\"teabag-env-info\"></li>\n </ul>\n </div>\n <div id=\"teabag-progress\"></div>\n <ul id=\"teabag-stats\">\n <li>passes: <b id=\"teabag-stats-passes\">0</b></li>\n <li>failures: <b id=\"teabag-stats-failures\">0</b></li>\n <li>skipped: <b id=\"teabag-stats-skipped\">0</b></li>\n <li>duration: <b id=\"teabag-stats-duration\">&infin;</b></li>\n </ul>\n </div>\n\n <div id=\"teabag-controls\" class=\"teabag-clearfix\">\n <div id=\"teabag-toggles\">\n <button id=\"teabag-use-catch\" title=\"Toggle using try/catch wrappers when possible\">Try/Catch</button>\n <button id=\"teabag-build-full-report\" title=\"Toggle building the full report\">Full Report</button>\n <button id=\"teabag-display-progress\" title=\"Toggle displaying progress as tests run\">Progress</button>\n </div>\n <div id=\"teabag-filter\">\n " + (this.buildSuiteSelect()) + "\n <button onclick=\"window.location.href = window.location.pathname\">Run All</button>\n <span id=\"teabag-filter-info\">\n </div>\n </div>\n\n <hr/>\n\n <div id=\"teabag-report\">\n <ol id=\"teabag-report-failures\"></ol>\n <ol id=\"teabag-report-all\"></ol>\n </div>\n</div>";
2389
+ return el.innerHTML = Teabag.Reporters.HTML.template;
2387
2390
  };
2388
2391
 
2389
2392
  HTML.prototype.buildSuiteSelect = function() {
@@ -2405,6 +2408,13 @@
2405
2408
  return this.progress.appendTo(this.findEl("progress"));
2406
2409
  };
2407
2410
 
2411
+ HTML.prototype.buildFilters = function() {
2412
+ if (this.filters.length) {
2413
+ this.setClass("filter", "teabag-filtered");
2414
+ }
2415
+ return this.setHtml("filter-list", "<li>" + (this.filters.join("</li><li>")) + "</li>", true);
2416
+ };
2417
+
2408
2418
  HTML.prototype.reportRunnerStarting = function(runner) {
2409
2419
  this.total.exist = runner.total || runner.specs().length;
2410
2420
  if (this.total.exist) {
@@ -2498,12 +2508,15 @@
2498
2508
  return document.body.className = "teabag-" + status;
2499
2509
  };
2500
2510
 
2501
- HTML.prototype.setFilter = function(filter) {
2502
- if (!filter) {
2503
- return;
2511
+ HTML.prototype.setFilters = function() {
2512
+ var link;
2513
+ link = [Teabag.root, Teabag.suites.active].join('/');
2514
+ if (Teabag.params["file"]) {
2515
+ this.filters.push("<a href='" + link + "'>remove</a> by file: " + Teabag.params["file"]);
2516
+ }
2517
+ if (Teabag.params["grep"]) {
2518
+ return this.filters.push("<a href='" + link + "'>remove</a> by match: " + Teabag.params["grep"]);
2504
2519
  }
2505
- this.setClass("filter", "teabag-filtered");
2506
- return this.setHtml("filter-info", "" + filter, true);
2507
2520
  };
2508
2521
 
2509
2522
  HTML.prototype.readConfig = function() {
@@ -2526,7 +2539,7 @@
2526
2539
  };
2527
2540
 
2528
2541
  HTML.prototype.changeSuite = function() {
2529
- return window.location.href = "/teabag/" + this.options[this.options.selectedIndex].value;
2542
+ return window.location.href = [Teabag.root, this.options[this.options.selectedIndex].value].join('/');
2530
2543
  };
2531
2544
 
2532
2545
  HTML.prototype.refresh = function() {
@@ -2545,7 +2558,7 @@
2545
2558
  } else {
2546
2559
  date = new Teabag.Date();
2547
2560
  date.setDate(date.getDate() + 365);
2548
- return document.cookie = "" + name + "=" + (escape(JSON.stringify(value))) + "; path=\"/\"; expires=" + (date.toUTCString()) + ";";
2561
+ return document.cookie = "" + name + "=" + (escape(JSON.stringify(value))) + "; expires=" + (date.toUTCString()) + "; path=/;";
2549
2562
  }
2550
2563
  };
2551
2564
 
@@ -2835,6 +2848,11 @@
2835
2848
 
2836
2849
  })(Teabag.Reporters.BaseView);
2837
2850
 
2851
+ }).call(this);
2852
+ (function() {
2853
+
2854
+ Teabag.Reporters.HTML.template = "<div id=\"teabag-interface\">\n <div class=\"teabag-clearfix\">\n <div id=\"teabag-title\">\n <h1>Teabag</h1>\n <ul>\n <li>version: <b id=\"teabag-version\"></b></li>\n <li id=\"teabag-env-info\"></li>\n </ul>\n </div>\n <div id=\"teabag-progress\"></div>\n <ul id=\"teabag-stats\">\n <li>passes: <b id=\"teabag-stats-passes\">0</b></li>\n <li>failures: <b id=\"teabag-stats-failures\">0</b></li>\n <li>skipped: <b id=\"teabag-stats-skipped\">0</b></li>\n <li>duration: <b id=\"teabag-stats-duration\">&infin;</b></li>\n </ul>\n </div>\n\n <div id=\"teabag-controls\" class=\"teabag-clearfix\">\n <div id=\"teabag-toggles\">\n <button id=\"teabag-use-catch\" title=\"Toggle using try/catch wrappers when possible\">Try/Catch</button>\n <button id=\"teabag-build-full-report\" title=\"Toggle building the full report\">Full Report</button>\n <button id=\"teabag-display-progress\" title=\"Toggle displaying progress as tests run\">Progress</button>\n </div>\n <div id=\"teabag-suites\"></div>\n </div>\n\n <hr/>\n\n <div id=\"teabag-filter\">\n <h1>Filtering</h1>\n <ul id=\"teabag-filter-list\"></ul>\n </div>\n\n <div id=\"teabag-report\">\n <ol id=\"teabag-report-failures\"></ol>\n <ol id=\"teabag-report-all\"></ol>\n </div>\n</div>";
2855
+
2838
2856
  }).call(this);
2839
2857
  (function() {
2840
2858
  var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
@@ -3144,9 +3162,7 @@
3144
3162
  }
3145
3163
 
3146
3164
  Runner.prototype.setup = function() {
3147
- var reporter;
3148
- reporter = new (this.getReporter())(env);
3149
- return typeof reporter.setFilter === "function" ? reporter.setFilter(this.params["grep"]) : void 0;
3165
+ return new (this.getReporter())(env);
3150
3166
  };
3151
3167
 
3152
3168
  return Runner;
@@ -0,0 +1,53 @@
1
+ (function() {
2
+ var TeabagInterface,
3
+ __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
4
+
5
+ TeabagInterface = (function() {
6
+
7
+ function TeabagInterface() {
8
+ this.filter = __bind(this.filter, this);
9
+ this.files = $u("#teabag-suite-list .file a");
10
+ this.input = $u("#teabag-filter-input")[0];
11
+ this.input.value = "";
12
+ this.input.onkeyup = this.filter;
13
+ }
14
+
15
+ TeabagInterface.prototype.filter = function() {
16
+ var file, _i, _len, _ref, _results;
17
+ _ref = this.files;
18
+ _results = [];
19
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
20
+ file = _ref[_i];
21
+ if (LiquidMetal.score(file.innerHTML, this.input.value) > 0) {
22
+ _results.push(file.parentNode.style.display = "block");
23
+ } else {
24
+ _results.push(file.parentNode.style.display = "none");
25
+ }
26
+ }
27
+ return _results;
28
+ };
29
+
30
+ return TeabagInterface;
31
+
32
+ })();
33
+
34
+ window.onload = function() {
35
+ return new TeabagInterface();
36
+ };
37
+
38
+
39
+ /*!
40
+ * LiquidMetal
41
+ * Copyright (c) 2009, Ryan McGeary (ryanonjavascript -[at]- mcgeary [*dot*] org)
42
+ */
43
+ var LiquidMetal=function(){var l=0.0;var m=1.0;var n=0.8;var o=0.9;var p=0.85;return{score:function(a,b){if(b.length==0)return n;if(b.length>a.length)return l;var c=this.buildScoreArray(a,b);var d=0.0;for(var i=0;i<c.length;i++){d+=c[i]}return(d/c.length)},buildScoreArray:function(a,b){var d=new Array(a.length);var e=a.toLowerCase();var f=b.toLowerCase().split("");var g=-1;var h=false;for(var i=0;i<f.length;i++){var c=f[i];var j=e.indexOf(c,g+1);if(j<0)return fillArray(d,l);if(j==0)h=true;if(isNewWord(a,j)){d[j-1]=1;fillArray(d,p,g+1,j-1)}else if(isUpperCase(a,j)){fillArray(d,p,g+1,j)}else{fillArray(d,l,g+1,j)}d[j]=m;g=j}var k=h?o:n;fillArray(d,k,g+1);return d}};function isUpperCase(a,b){var c=a.charAt(b);return("A"<=c&&c<="Z")}function isNewWord(a,b){var c=a.charAt(b-1);return(c==" "||c=="\t")}function fillArray(a,b,c,d){c=Math.max(c||0,0);d=Math.min(d||a.length,a.length);for(var i=c;i<d;i++){a[i]=b}return a}}();
44
+
45
+ /*!
46
+ * uSelector
47
+ * author: Fabio Miranda Costa | github: fabiomcosta | twitter: @fabiomiranda | license: MIT-style license
48
+ */
49
+ (function(h,i){var f,c,j,k,m={},e,l,q=/^\s+|\s+$/g,r=!!i.querySelectorAll,g=function(d,b,a){f=a||[];e=b||g.context;if(r)try{n(e.querySelectorAll(d));return f}catch(v){}l=e.ownerDocument||e;d=d.replace(q,"");for(c={};d=d.replace(/([#.:])?([^#.:]*)/,s););d=(b=c.id)&&c.tag||c.classes||c.pseudos||!b&&(c.classes||c.pseudos)?t:o;if(b){if(a=b=l.getElementById(b))if(!(a=l===e))a:{a=b;do if(a===e){a=true;break a}while(a=a.parentNode);a=false}a&&d([b])}else d(e.getElementsByTagName(c.tag||"*"));return f},u=function(d){if(c.tag){var b=d.nodeName.toUpperCase();if(c.tag=="*"){if(b<"@")return false}else if(b!=c.tag)return false}if(c.id&&d.getAttribute("id")!=c.id)return false;if(j=c.classes){var a=" "+d.className+" ";for(b=j.length;b--;)if(a.indexOf(" "+j[b]+" ")<0)return false}if(k=c.pseudos)for(b=k.length;b--;){a=m[k[b]];if(!(a&&a.call(g,d)))return false}return true},s=function(d,b,a){if(b)if(b=="#")c.id=a;else if(b==".")if(c.classes)c.classes.push(a);else c.classes=[a];else{if(b==":")if(c.pseudos)c.pseudos.push(a);else c.pseudos=[a]}else c.tag=a.toUpperCase();return""},p=Array.prototype.slice,n=function(d){f=p.call(d,0)},o=function(d){for(var b=0,a;a=d[b++];)f.push(a)};try{p.call(i.documentElement.childNodes,0)}catch(w){n=o}var t=function(d){for(var b=0,a;a=d[b++];)u(a)&&f.push(a)};g.pseudos=m;g.context=i;h.uSelector=g;h.$u||(h.$u=g)})(this,document);
50
+ ;
51
+
52
+
53
+ }).call(this);
@@ -4,6 +4,7 @@
4
4
  #= require teabag/base/reporters/html/spec_view
5
5
  #= require teabag/base/reporters/html/failure_view
6
6
  #= require teabag/base/reporters/html/suite_view
7
+ #= require teabag/base/reporters/html/template
7
8
 
8
9
  class Teabag.Reporters.HTML extends Teabag.Reporters.BaseView
9
10
 
@@ -12,72 +13,40 @@ class Teabag.Reporters.HTML extends Teabag.Reporters.BaseView
12
13
  @config = {"use-catch": true, "build-full-report": false, "display-progress": true}
13
14
  @total = {exist: 0, run: 0, passes: 0, failures: 0, skipped: 0}
14
15
  @views = {specs: {}, suites: {}}
15
- @filter = false
16
+ @filters = []
17
+ @setFilters()
16
18
  @readConfig()
17
19
  super
18
20
 
19
21
 
20
22
  build: ->
21
23
  @buildLayout()
22
- @el = @findEl("report-all")
24
+
23
25
  @setText("env-info", @envInfo())
24
26
  @setText("version", Teabag.version)
25
27
  @findEl("toggles").onclick = @toggleConfig
28
+
29
+ @findEl("suites").innerHTML = @buildSuiteSelect()
26
30
  @findEl("suite-select")?.onchange = @changeSuite
31
+
32
+ @el = @findEl("report-all")
33
+
27
34
  @showConfiguration()
28
35
  @buildProgress()
36
+ @buildFilters()
29
37
 
30
38
 
31
39
  buildLayout: ->
32
40
  el = @createEl("div")
33
41
  document.body.appendChild(el)
34
- el.innerHTML = """
35
- <div id="teabag-html-reporter">
36
- <div class="teabag-clearfix">
37
- <div id="teabag-title">
38
- <h1>Teabag</h1>
39
- <ul>
40
- <li>version: <b id="teabag-version"></b></li>
41
- <li id="teabag-env-info"></li>
42
- </ul>
43
- </div>
44
- <div id="teabag-progress"></div>
45
- <ul id="teabag-stats">
46
- <li>passes: <b id="teabag-stats-passes">0</b></li>
47
- <li>failures: <b id="teabag-stats-failures">0</b></li>
48
- <li>skipped: <b id="teabag-stats-skipped">0</b></li>
49
- <li>duration: <b id="teabag-stats-duration">&infin;</b></li>
50
- </ul>
51
- </div>
52
-
53
- <div id="teabag-controls" class="teabag-clearfix">
54
- <div id="teabag-toggles">
55
- <button id="teabag-use-catch" title="Toggle using try/catch wrappers when possible">Try/Catch</button>
56
- <button id="teabag-build-full-report" title="Toggle building the full report">Full Report</button>
57
- <button id="teabag-display-progress" title="Toggle displaying progress as tests run">Progress</button>
58
- </div>
59
- <div id="teabag-filter">
60
- #{@buildSuiteSelect()}
61
- <button onclick="window.location.href = window.location.pathname">Run All</button>
62
- <span id="teabag-filter-info">
63
- </div>
64
- </div>
65
-
66
- <hr/>
67
-
68
- <div id="teabag-report">
69
- <ol id="teabag-report-failures"></ol>
70
- <ol id="teabag-report-all"></ol>
71
- </div>
72
- </div>
73
- """
42
+ el.innerHTML = Teabag.Reporters.HTML.template
74
43
 
75
44
 
76
45
  buildSuiteSelect: ->
77
46
  return "" if Teabag.suites.all.length == 1
78
47
  options = []
79
48
  for suite in Teabag.suites.all
80
- options.push("""<option#{if Teabag.suites.active == suite then " selected='selected'" else ""} value="#{suite}">#{suite} suite</option>""")
49
+ options.push("""<option#{if Teabag.suites.active == suite then " selected='selected'" else ""} value="#{suite}">#{suite}</option>""")
81
50
  """<select id="teabag-suite-select">#{options.join("")}</select>"""
82
51
 
83
52
 
@@ -86,6 +55,11 @@ class Teabag.Reporters.HTML extends Teabag.Reporters.BaseView
86
55
  @progress.appendTo(@findEl("progress"))
87
56
 
88
57
 
58
+ buildFilters: ->
59
+ @setClass("filter", "teabag-filtered") if @filters.length
60
+ @setHtml("filter-list", "<li>#{@filters.join("</li><li>")}", true)
61
+
62
+
89
63
  reportRunnerStarting: (runner) ->
90
64
  @total.exist = runner.total || runner.specs().length
91
65
  @setText("stats-duration", "...") if @total.exist
@@ -157,10 +131,10 @@ class Teabag.Reporters.HTML extends Teabag.Reporters.BaseView
157
131
  document.body.className = "teabag-#{status}"
158
132
 
159
133
 
160
- setFilter: (filter) ->
161
- return unless filter
162
- @setClass("filter", "teabag-filtered")
163
- @setHtml("filter-info", "#{filter}", true)
134
+ setFilters: ->
135
+ link = [Teabag.root, Teabag.suites.active].join('/')
136
+ @filters.push("<a href='#{link}'>remove</a> by file: #{Teabag.params["file"]}") if Teabag.params["file"]
137
+ @filters.push("<a href='#{link}'>remove</a> by match: #{Teabag.params["grep"]}") if Teabag.params["grep"]
164
138
 
165
139
 
166
140
  readConfig: ->
@@ -177,7 +151,7 @@ class Teabag.Reporters.HTML extends Teabag.Reporters.BaseView
177
151
 
178
152
 
179
153
  changeSuite: ->
180
- window.location.href = "/teabag/#{@options[@options.selectedIndex].value}"
154
+ window.location.href = [Teabag.root, @options[@options.selectedIndex].value].join('/')
181
155
 
182
156
 
183
157
  refresh: ->
@@ -192,4 +166,4 @@ class Teabag.Reporters.HTML extends Teabag.Reporters.BaseView
192
166
  else
193
167
  date = new Teabag.Date()
194
168
  date.setDate(date.getDate() + 365)
195
- document.cookie = "#{name}=#{escape(JSON.stringify(value))}; path=\"/\"; expires=#{date.toUTCString()};"
169
+ document.cookie = "#{name}=#{escape(JSON.stringify(value))}; expires=#{date.toUTCString()}; path=/;"