tabulous 0.0.1

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 (292) hide show
  1. data/.gitignore +5 -0
  2. data/CHANGELOG.rdoc +2 -0
  3. data/Gemfile +4 -0
  4. data/MIT-LICENSE +21 -0
  5. data/README.rdoc +85 -0
  6. data/Rakefile +54 -0
  7. data/lib/generators/tabs/USAGE +1 -0
  8. data/lib/generators/tabs/tabs_generator.rb +13 -0
  9. data/lib/generators/tabs/templates/tabulous.rb +170 -0
  10. data/lib/tabulous.rb +11 -0
  11. data/lib/tabulous/css_scaffolding.rb +111 -0
  12. data/lib/tabulous/errors.rb +16 -0
  13. data/lib/tabulous/formatter.rb +278 -0
  14. data/lib/tabulous/helpers.rb +13 -0
  15. data/lib/tabulous/options.rb +37 -0
  16. data/lib/tabulous/railtie.rb +23 -0
  17. data/lib/tabulous/tab.rb +79 -0
  18. data/lib/tabulous/tabulous.rb +162 -0
  19. data/lib/tabulous/version.rb +3 -0
  20. data/lib/tasks/tabulous.rake +11 -0
  21. data/tabulous.gemspec +30 -0
  22. data/test/applications/main/.gitignore +3 -0
  23. data/test/applications/main/Gemfile +7 -0
  24. data/test/applications/main/Rakefile +7 -0
  25. data/test/applications/main/app/controllers/application_controller.rb +3 -0
  26. data/test/applications/main/app/controllers/galaxies_controller.rb +83 -0
  27. data/test/applications/main/app/controllers/home_controller.rb +4 -0
  28. data/test/applications/main/app/controllers/planets_controller.rb +83 -0
  29. data/test/applications/main/app/controllers/stars_controller.rb +83 -0
  30. data/test/applications/main/app/controllers/subtabs_controller.rb +8 -0
  31. data/test/applications/main/app/helpers/application_helper.rb +2 -0
  32. data/test/applications/main/app/helpers/galaxies_helper.rb +2 -0
  33. data/test/applications/main/app/helpers/planets_helper.rb +2 -0
  34. data/test/applications/main/app/helpers/stars_helper.rb +2 -0
  35. data/test/applications/main/app/models/galaxy.rb +2 -0
  36. data/test/applications/main/app/models/planet.rb +2 -0
  37. data/test/applications/main/app/models/star.rb +2 -0
  38. data/test/applications/main/app/views/galaxies/_form.html.erb +21 -0
  39. data/test/applications/main/app/views/galaxies/edit.html.erb +6 -0
  40. data/test/applications/main/app/views/galaxies/index.html.erb +23 -0
  41. data/test/applications/main/app/views/galaxies/new.html.erb +5 -0
  42. data/test/applications/main/app/views/galaxies/show.html.erb +10 -0
  43. data/test/applications/main/app/views/home/index.html.erb +3 -0
  44. data/test/applications/main/app/views/layouts/application.html.erb +16 -0
  45. data/test/applications/main/app/views/planets/_form.html.erb +21 -0
  46. data/test/applications/main/app/views/planets/edit.html.erb +6 -0
  47. data/test/applications/main/app/views/planets/index.html.erb +23 -0
  48. data/test/applications/main/app/views/planets/new.html.erb +5 -0
  49. data/test/applications/main/app/views/planets/show.html.erb +10 -0
  50. data/test/applications/main/app/views/stars/_form.html.erb +21 -0
  51. data/test/applications/main/app/views/stars/edit.html.erb +6 -0
  52. data/test/applications/main/app/views/stars/index.html.erb +23 -0
  53. data/test/applications/main/app/views/stars/new.html.erb +5 -0
  54. data/test/applications/main/app/views/stars/show.html.erb +10 -0
  55. data/test/applications/main/app/views/subtabs/one.html.erb +1 -0
  56. data/test/applications/main/app/views/subtabs/three.html.erb +1 -0
  57. data/test/applications/main/app/views/subtabs/two.html.erb +1 -0
  58. data/test/applications/main/config.ru +4 -0
  59. data/test/applications/main/config/application.rb +42 -0
  60. data/test/applications/main/config/boot.rb +13 -0
  61. data/test/applications/main/config/database.yml +22 -0
  62. data/test/applications/main/config/environment.rb +5 -0
  63. data/test/applications/main/config/environments/development.rb +26 -0
  64. data/test/applications/main/config/environments/production.rb +49 -0
  65. data/test/applications/main/config/environments/test.rb +35 -0
  66. data/test/applications/main/config/initializers/backtrace_silencers.rb +7 -0
  67. data/test/applications/main/config/initializers/inflections.rb +10 -0
  68. data/test/applications/main/config/initializers/mime_types.rb +5 -0
  69. data/test/applications/main/config/initializers/secret_token.rb +7 -0
  70. data/test/applications/main/config/initializers/session_store.rb +8 -0
  71. data/test/applications/main/config/initializers/tabulous.rb +156 -0
  72. data/test/applications/main/config/locales/en.yml +5 -0
  73. data/test/applications/main/config/routes.rb +69 -0
  74. data/test/applications/main/db/development.sqlite3 +0 -0
  75. data/test/applications/main/db/migrate/20110223232547_create_galaxies.rb +13 -0
  76. data/test/applications/main/db/migrate/20110223232552_create_stars.rb +13 -0
  77. data/test/applications/main/db/migrate/20110223232557_create_planets.rb +13 -0
  78. data/test/applications/main/db/production.sqlite3 +0 -0
  79. data/test/applications/main/db/schema.rb +33 -0
  80. data/test/applications/main/db/test.sqlite3 +0 -0
  81. data/test/applications/main/public/404.html +26 -0
  82. data/test/applications/main/public/422.html +26 -0
  83. data/test/applications/main/public/500.html +26 -0
  84. data/test/applications/main/public/favicon.ico +0 -0
  85. data/test/applications/main/public/javascripts/application.js +2 -0
  86. data/test/applications/main/public/javascripts/controls.js +965 -0
  87. data/test/applications/main/public/javascripts/dragdrop.js +974 -0
  88. data/test/applications/main/public/javascripts/effects.js +1123 -0
  89. data/test/applications/main/public/javascripts/prototype.js +6001 -0
  90. data/test/applications/main/public/javascripts/rails.js +175 -0
  91. data/test/applications/main/public/stylesheets/.gitkeep +0 -0
  92. data/test/applications/main/script/rails +6 -0
  93. data/test/applications/main/test/integration/actions_test.rb +79 -0
  94. data/test/applications/main/test/integration/active_tab_clickable_test.rb +86 -0
  95. data/test/applications/main/test/integration/always_render_subtabs_test.rb +84 -0
  96. data/test/applications/main/test/integration/css_no_scaffolding_test.rb +57 -0
  97. data/test/applications/main/test/integration/css_scaffolding_test.rb +67 -0
  98. data/test/applications/main/test/integration/display_text_test.rb +73 -0
  99. data/test/applications/main/test/integration/enabled_test.rb +80 -0
  100. data/test/applications/main/test/integration/html5_test.rb +64 -0
  101. data/test/applications/main/test/integration/main_tabs_test.rb +10 -0
  102. data/test/applications/main/test/integration/path_test.rb +81 -0
  103. data/test/applications/main/test/integration/visible_test.rb +80 -0
  104. data/test/applications/main/test/integration_test_helper.rb +6 -0
  105. data/test/applications/main/test/test_helper.rb +8 -0
  106. data/test/applications/main/test/unit/tabs_generator_test.rb +14 -0
  107. data/test/applications/simple_tabs/.gitignore +3 -0
  108. data/test/applications/simple_tabs/Gemfile +7 -0
  109. data/test/applications/simple_tabs/Rakefile +7 -0
  110. data/test/applications/simple_tabs/app/controllers/application_controller.rb +3 -0
  111. data/test/applications/simple_tabs/app/controllers/galaxies_controller.rb +83 -0
  112. data/test/applications/simple_tabs/app/controllers/home_controller.rb +4 -0
  113. data/test/applications/simple_tabs/app/controllers/planets_controller.rb +83 -0
  114. data/test/applications/simple_tabs/app/controllers/stars_controller.rb +83 -0
  115. data/test/applications/simple_tabs/app/helpers/application_helper.rb +2 -0
  116. data/test/applications/simple_tabs/app/helpers/galaxies_helper.rb +2 -0
  117. data/test/applications/simple_tabs/app/helpers/planets_helper.rb +2 -0
  118. data/test/applications/simple_tabs/app/helpers/stars_helper.rb +2 -0
  119. data/test/applications/simple_tabs/app/models/galaxy.rb +2 -0
  120. data/test/applications/simple_tabs/app/models/planet.rb +2 -0
  121. data/test/applications/simple_tabs/app/models/star.rb +2 -0
  122. data/test/applications/simple_tabs/app/views/galaxies/_form.html.erb +21 -0
  123. data/test/applications/simple_tabs/app/views/galaxies/edit.html.erb +6 -0
  124. data/test/applications/simple_tabs/app/views/galaxies/index.html.erb +23 -0
  125. data/test/applications/simple_tabs/app/views/galaxies/new.html.erb +5 -0
  126. data/test/applications/simple_tabs/app/views/galaxies/show.html.erb +10 -0
  127. data/test/applications/simple_tabs/app/views/home/index.html.erb +4 -0
  128. data/test/applications/simple_tabs/app/views/layouts/application.html.erb +16 -0
  129. data/test/applications/simple_tabs/app/views/planets/_form.html.erb +21 -0
  130. data/test/applications/simple_tabs/app/views/planets/edit.html.erb +6 -0
  131. data/test/applications/simple_tabs/app/views/planets/index.html.erb +23 -0
  132. data/test/applications/simple_tabs/app/views/planets/new.html.erb +5 -0
  133. data/test/applications/simple_tabs/app/views/planets/show.html.erb +10 -0
  134. data/test/applications/simple_tabs/app/views/stars/_form.html.erb +21 -0
  135. data/test/applications/simple_tabs/app/views/stars/edit.html.erb +6 -0
  136. data/test/applications/simple_tabs/app/views/stars/index.html.erb +23 -0
  137. data/test/applications/simple_tabs/app/views/stars/new.html.erb +5 -0
  138. data/test/applications/simple_tabs/app/views/stars/show.html.erb +10 -0
  139. data/test/applications/simple_tabs/config.ru +4 -0
  140. data/test/applications/simple_tabs/config/application.rb +42 -0
  141. data/test/applications/simple_tabs/config/boot.rb +13 -0
  142. data/test/applications/simple_tabs/config/database.yml +22 -0
  143. data/test/applications/simple_tabs/config/environment.rb +5 -0
  144. data/test/applications/simple_tabs/config/environments/development.rb +26 -0
  145. data/test/applications/simple_tabs/config/environments/production.rb +49 -0
  146. data/test/applications/simple_tabs/config/environments/test.rb +35 -0
  147. data/test/applications/simple_tabs/config/initializers/backtrace_silencers.rb +7 -0
  148. data/test/applications/simple_tabs/config/initializers/inflections.rb +10 -0
  149. data/test/applications/simple_tabs/config/initializers/mime_types.rb +5 -0
  150. data/test/applications/simple_tabs/config/initializers/secret_token.rb +7 -0
  151. data/test/applications/simple_tabs/config/initializers/session_store.rb +8 -0
  152. data/test/applications/simple_tabs/config/initializers/tabulous.rb +149 -0
  153. data/test/applications/simple_tabs/config/locales/en.yml +5 -0
  154. data/test/applications/simple_tabs/config/routes.rb +65 -0
  155. data/test/applications/simple_tabs/db/development.sqlite3 +0 -0
  156. data/test/applications/simple_tabs/db/migrate/20110220170240_create_galaxies.rb +13 -0
  157. data/test/applications/simple_tabs/db/migrate/20110220170245_create_stars.rb +13 -0
  158. data/test/applications/simple_tabs/db/migrate/20110220170250_create_planets.rb +13 -0
  159. data/test/applications/simple_tabs/db/production.sqlite3 +0 -0
  160. data/test/applications/simple_tabs/db/schema.rb +33 -0
  161. data/test/applications/simple_tabs/db/test.sqlite3 +0 -0
  162. data/test/applications/simple_tabs/public/404.html +26 -0
  163. data/test/applications/simple_tabs/public/422.html +26 -0
  164. data/test/applications/simple_tabs/public/500.html +26 -0
  165. data/test/applications/simple_tabs/public/favicon.ico +0 -0
  166. data/test/applications/simple_tabs/public/javascripts/application.js +2 -0
  167. data/test/applications/simple_tabs/public/javascripts/controls.js +965 -0
  168. data/test/applications/simple_tabs/public/javascripts/dragdrop.js +974 -0
  169. data/test/applications/simple_tabs/public/javascripts/effects.js +1123 -0
  170. data/test/applications/simple_tabs/public/javascripts/prototype.js +6001 -0
  171. data/test/applications/simple_tabs/public/javascripts/rails.js +175 -0
  172. data/test/applications/simple_tabs/public/stylesheets/.gitkeep +0 -0
  173. data/test/applications/simple_tabs/script/rails +6 -0
  174. data/test/applications/simple_tabs/test/integration/simple_tabs_test.rb +34 -0
  175. data/test/applications/simple_tabs/test/integration_test_helper.rb +6 -0
  176. data/test/applications/simple_tabs/test/test_helper.rb +8 -0
  177. data/test/applications/subtabs/.gitignore +3 -0
  178. data/test/applications/subtabs/Gemfile +7 -0
  179. data/test/applications/subtabs/Rakefile +7 -0
  180. data/test/applications/subtabs/app/controllers/application_controller.rb +3 -0
  181. data/test/applications/subtabs/app/controllers/exoplanets_controller.rb +83 -0
  182. data/test/applications/subtabs/app/controllers/galaxies/elliptical_galaxies_controller.rb +85 -0
  183. data/test/applications/subtabs/app/controllers/galaxies/lenticular_galaxies_controller.rb +85 -0
  184. data/test/applications/subtabs/app/controllers/galaxies/spiral_galaxies_controller.rb +85 -0
  185. data/test/applications/subtabs/app/controllers/home_controller.rb +4 -0
  186. data/test/applications/subtabs/app/controllers/misc_controller.rb +15 -0
  187. data/test/applications/subtabs/app/controllers/rogue_planets_controller.rb +83 -0
  188. data/test/applications/subtabs/app/controllers/stars_controller.rb +83 -0
  189. data/test/applications/subtabs/app/helpers/application_helper.rb +2 -0
  190. data/test/applications/subtabs/app/helpers/elliptical_galaxies_helper.rb +2 -0
  191. data/test/applications/subtabs/app/helpers/exoplanets_helper.rb +2 -0
  192. data/test/applications/subtabs/app/helpers/lenticular_galaxies_helper.rb +2 -0
  193. data/test/applications/subtabs/app/helpers/rogue_planets_helper.rb +2 -0
  194. data/test/applications/subtabs/app/helpers/spiral_galaxies_helper.rb +2 -0
  195. data/test/applications/subtabs/app/helpers/stars_helper.rb +2 -0
  196. data/test/applications/subtabs/app/models/elliptical_galaxy.rb +2 -0
  197. data/test/applications/subtabs/app/models/exoplanet.rb +2 -0
  198. data/test/applications/subtabs/app/models/lenticular_galaxy.rb +2 -0
  199. data/test/applications/subtabs/app/models/rogue_planet.rb +2 -0
  200. data/test/applications/subtabs/app/models/spiral_galaxy.rb +2 -0
  201. data/test/applications/subtabs/app/models/star.rb +2 -0
  202. data/test/applications/subtabs/app/views/exoplanets/_form.html.erb +21 -0
  203. data/test/applications/subtabs/app/views/exoplanets/edit.html.erb +6 -0
  204. data/test/applications/subtabs/app/views/exoplanets/index.html.erb +23 -0
  205. data/test/applications/subtabs/app/views/exoplanets/new.html.erb +5 -0
  206. data/test/applications/subtabs/app/views/exoplanets/show.html.erb +10 -0
  207. data/test/applications/subtabs/app/views/galaxies/elliptical_galaxies/_form.html.erb +21 -0
  208. data/test/applications/subtabs/app/views/galaxies/elliptical_galaxies/edit.html.erb +6 -0
  209. data/test/applications/subtabs/app/views/galaxies/elliptical_galaxies/index.html.erb +23 -0
  210. data/test/applications/subtabs/app/views/galaxies/elliptical_galaxies/new.html.erb +5 -0
  211. data/test/applications/subtabs/app/views/galaxies/elliptical_galaxies/show.html.erb +10 -0
  212. data/test/applications/subtabs/app/views/galaxies/lenticular_galaxies/_form.html.erb +21 -0
  213. data/test/applications/subtabs/app/views/galaxies/lenticular_galaxies/edit.html.erb +6 -0
  214. data/test/applications/subtabs/app/views/galaxies/lenticular_galaxies/index.html.erb +23 -0
  215. data/test/applications/subtabs/app/views/galaxies/lenticular_galaxies/new.html.erb +5 -0
  216. data/test/applications/subtabs/app/views/galaxies/lenticular_galaxies/show.html.erb +10 -0
  217. data/test/applications/subtabs/app/views/galaxies/spiral_galaxies/_form.html.erb +21 -0
  218. data/test/applications/subtabs/app/views/galaxies/spiral_galaxies/edit.html.erb +6 -0
  219. data/test/applications/subtabs/app/views/galaxies/spiral_galaxies/index.html.erb +23 -0
  220. data/test/applications/subtabs/app/views/galaxies/spiral_galaxies/new.html.erb +5 -0
  221. data/test/applications/subtabs/app/views/galaxies/spiral_galaxies/show.html.erb +10 -0
  222. data/test/applications/subtabs/app/views/home/index.html.erb +14 -0
  223. data/test/applications/subtabs/app/views/layouts/application.html.erb +21 -0
  224. data/test/applications/subtabs/app/views/misc/always_enabled.html.erb +4 -0
  225. data/test/applications/subtabs/app/views/misc/always_visible.html.erb +4 -0
  226. data/test/applications/subtabs/app/views/rogue_planets/_form.html.erb +21 -0
  227. data/test/applications/subtabs/app/views/rogue_planets/edit.html.erb +6 -0
  228. data/test/applications/subtabs/app/views/rogue_planets/index.html.erb +23 -0
  229. data/test/applications/subtabs/app/views/rogue_planets/new.html.erb +5 -0
  230. data/test/applications/subtabs/app/views/rogue_planets/show.html.erb +10 -0
  231. data/test/applications/subtabs/app/views/stars/_form.html.erb +21 -0
  232. data/test/applications/subtabs/app/views/stars/edit.html.erb +6 -0
  233. data/test/applications/subtabs/app/views/stars/index.html.erb +23 -0
  234. data/test/applications/subtabs/app/views/stars/new.html.erb +5 -0
  235. data/test/applications/subtabs/app/views/stars/show.html.erb +10 -0
  236. data/test/applications/subtabs/config.ru +4 -0
  237. data/test/applications/subtabs/config/application.rb +42 -0
  238. data/test/applications/subtabs/config/boot.rb +13 -0
  239. data/test/applications/subtabs/config/database.yml +22 -0
  240. data/test/applications/subtabs/config/environment.rb +5 -0
  241. data/test/applications/subtabs/config/environments/development.rb +26 -0
  242. data/test/applications/subtabs/config/environments/production.rb +49 -0
  243. data/test/applications/subtabs/config/environments/test.rb +35 -0
  244. data/test/applications/subtabs/config/initializers/backtrace_silencers.rb +7 -0
  245. data/test/applications/subtabs/config/initializers/inflections.rb +10 -0
  246. data/test/applications/subtabs/config/initializers/mime_types.rb +5 -0
  247. data/test/applications/subtabs/config/initializers/secret_token.rb +7 -0
  248. data/test/applications/subtabs/config/initializers/session_store.rb +8 -0
  249. data/test/applications/subtabs/config/initializers/tabulous.rb +167 -0
  250. data/test/applications/subtabs/config/locales/en.yml +5 -0
  251. data/test/applications/subtabs/config/routes.rb +74 -0
  252. data/test/applications/subtabs/db/development.sqlite3 +0 -0
  253. data/test/applications/subtabs/db/migrate/20110223220628_create_galaxies.rb +13 -0
  254. data/test/applications/subtabs/db/migrate/20110223220634_create_stars.rb +13 -0
  255. data/test/applications/subtabs/db/migrate/20110223220640_create_planets.rb +13 -0
  256. data/test/applications/subtabs/db/migrate/20110226190125_create_rogue_planets.rb +13 -0
  257. data/test/applications/subtabs/db/migrate/20110226190131_create_exoplanets.rb +13 -0
  258. data/test/applications/subtabs/db/migrate/20110226190532_create_spiral_galaxies.rb +13 -0
  259. data/test/applications/subtabs/db/migrate/20110226190537_create_lenticular_galaxies.rb +13 -0
  260. data/test/applications/subtabs/db/migrate/20110226190543_create_elliptical_galaxies.rb +13 -0
  261. data/test/applications/subtabs/db/production.sqlite3 +0 -0
  262. data/test/applications/subtabs/db/schema.rb +63 -0
  263. data/test/applications/subtabs/db/test.sqlite3 +0 -0
  264. data/test/applications/subtabs/public/404.html +26 -0
  265. data/test/applications/subtabs/public/422.html +26 -0
  266. data/test/applications/subtabs/public/500.html +26 -0
  267. data/test/applications/subtabs/public/favicon.ico +0 -0
  268. data/test/applications/subtabs/public/javascripts/application.js +2 -0
  269. data/test/applications/subtabs/public/javascripts/controls.js +965 -0
  270. data/test/applications/subtabs/public/javascripts/dragdrop.js +974 -0
  271. data/test/applications/subtabs/public/javascripts/effects.js +1123 -0
  272. data/test/applications/subtabs/public/javascripts/prototype.js +6001 -0
  273. data/test/applications/subtabs/public/javascripts/rails.js +175 -0
  274. data/test/applications/subtabs/public/stylesheets/.gitkeep +0 -0
  275. data/test/applications/subtabs/public/stylesheets/application.css +49 -0
  276. data/test/applications/subtabs/public/stylesheets/reset.css +48 -0
  277. data/test/applications/subtabs/script/rails +6 -0
  278. data/test/applications/subtabs/test/integration/subtabs_test.rb +67 -0
  279. data/test/applications/subtabs/test/integration_test_helper.rb +6 -0
  280. data/test/applications/subtabs/test/test_helper.rb +8 -0
  281. data/test/test_application_gemfile.rb +14 -0
  282. data/test/test_application_integration_test_helper.rb +89 -0
  283. data/test/test_application_test_helper.rb +11 -0
  284. data/test/test_initializers/empty +0 -0
  285. data/test/test_initializers/expected +55 -0
  286. data/test/test_initializers/random_horizontal_whitespace +55 -0
  287. data/test/test_initializers/random_vertical_whitespace +102 -0
  288. data/test/test_initializers/text +144 -0
  289. data/test/test_initializers/trailing_comments +55 -0
  290. data/test/unit_test_helper.rb +13 -0
  291. data/test/units/tabulous_formatter_test.rb +69 -0
  292. metadata +466 -0
@@ -0,0 +1,11 @@
1
+ require 'redgreen' unless RUBY_VERSION >= "1.9"
2
+
3
+ class ActiveSupport::TestCase
4
+ # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
5
+ #
6
+ # Note: You'll currently still have to declare fixtures explicitly in integration tests
7
+ # -- they do not yet inherit this setting
8
+ # fixtures :all
9
+
10
+ # Add more helper methods to be used by all tests here...
11
+ end
File without changes
@@ -0,0 +1,55 @@
1
+ Tabulous.setup do |config|
2
+
3
+ config.tabs = [
4
+ #----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
5
+ # TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? #
6
+ #----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
7
+ [ :home_tab , 'Explanation' , '/' , true , true ],
8
+ [ :galaxies_tab , 'Galaxies' , '/galaxies/elliptical_galaxies' , true , true ],
9
+ [ :elliptical_galaxies_subtab , 'Elliptical Galaxies' , '/galaxies/elliptical_galaxies' , true , true ],
10
+ [ :spiral_galaxies_subtab , 'Spiral Galaxies' , '/galaxies/spiral_galaxies' , true , true ],
11
+ [ :lenticular_galaxies_subtab , 'Lenticular Galaxies' , '/galaxies/lenticular_galaxies' , true , true ],
12
+ [ :planets_tab , 'Planets' , '/exoplanets' , true , true ],
13
+ [ :exoplanets_subtab , 'Exoplanets' , '/exoplanets' , true , true ],
14
+ [ :rogue_planets_subtab , 'Rogue Planets' , '/rogue_planets' , true , true ],
15
+ [ :stars_tab , 'Stars' , '/stars' , true , true ],
16
+ [ :hidden_tab , 'Hidden' , '/hidden/always_visible' , lambda { request.path =~ /(hidden|galaxies)/ } , true ],
17
+ [ :always_visible_subtab , 'Always Visible' , '/hidden/always_visible' , true , true ],
18
+ [ :always_hidden_subtab , 'Always Hidden' , '/hidden/always_hidden' , false , true ],
19
+ [ :disabled_tab , 'Disabled' , '/disabled/always_enabled' , true , lambda { request.path =~ /(disabled|stars)/ } ],
20
+ [ :always_enabled_subtab , 'Always Enabled' , '/disabled/always_enabled' , true , true ],
21
+ [ :always_disabled_subtab , 'Always Disabled' , '/disabled/always_disabled' , true , false ],
22
+ #----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
23
+ # TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? #
24
+ #----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
25
+ ]
26
+
27
+ config.actions = [
28
+ #-----------------------------------------------------------------------------------------#
29
+ # CONTROLLER | ACTION | TAB #
30
+ #-----------------------------------------------------------------------------------------#
31
+ [ :home , :all_actions , :home_tab ],
32
+ [ :elliptical_galaxies , :all_actions , :elliptical_galaxies_subtab ],
33
+ [ :spiral_galaxies , :all_actions , :spiral_galaxies_subtab ],
34
+ [ :lenticular_galaxies , :all_actions , :lenticular_galaxies_subtab ],
35
+ [ :exoplanets , :all_actions , :exoplanets_subtab ],
36
+ [ :rogue_planets , :all_actions , :rogue_planets_subtab ],
37
+ [ :stars , :all_actions , :stars_tab ],
38
+ [ :misc , :always_visible , :always_visible_subtab ],
39
+ [ :misc , :always_hidden , :always_hidden_subtab ],
40
+ [ :misc , :always_enabled , :always_enabled_subtab ],
41
+ [ :misc , :always_disabled , :always_disabled_subtab ],
42
+ #-----------------------------------------------------------------------------------------#
43
+ # CONTROLLER | ACTION | TAB #
44
+ #-----------------------------------------------------------------------------------------#
45
+ ]
46
+
47
+ config.css.scaffolding = true
48
+ config.css.background_color = '#cec'
49
+ config.css.text_color = '#464'
50
+ config.css.active_tab_color = '#fff'
51
+ config.css.hover_tab_color = '#dfd'
52
+ config.css.inactive_tab_color = '#aca'
53
+ config.css.inactive_text_color = '#8a8'
54
+
55
+ end
@@ -0,0 +1,55 @@
1
+ Tabulous.setup do |config|
2
+
3
+ config.tabs = [
4
+ #----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
5
+ # TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? #
6
+ #----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
7
+ [ :home_tab , 'Explanation' , '/' , true , true ],
8
+ [ :galaxies_tab , 'Galaxies' , '/galaxies/elliptical_galaxies' , true , true ],
9
+ [ :elliptical_galaxies_subtab , 'Elliptical Galaxies' , '/galaxies/elliptical_galaxies' , true , true ],
10
+ [ :spiral_galaxies_subtab , 'Spiral Galaxies' , '/galaxies/spiral_galaxies' , true , true ],
11
+ [ :lenticular_galaxies_subtab , 'Lenticular Galaxies' , '/galaxies/lenticular_galaxies' , true , true ],
12
+ [ :planets_tab , 'Planets' , '/exoplanets' , true , true ],
13
+ [ :exoplanets_subtab , 'Exoplanets' , '/exoplanets' , true , true ],
14
+ [ :rogue_planets_subtab , 'Rogue Planets' , '/rogue_planets' , true , true ],
15
+ [ :stars_tab , 'Stars' , '/stars' , true , true ],
16
+ [ :hidden_tab , 'Hidden' , '/hidden/always_visible' , lambda { request.path =~ /(hidden|galaxies)/ } , true ],
17
+ [ :always_visible_subtab , 'Always Visible' , '/hidden/always_visible' , true , true ],
18
+ [ :always_hidden_subtab , 'Always Hidden' , '/hidden/always_hidden' , false , true ],
19
+ [ :disabled_tab , 'Disabled' , '/disabled/always_enabled' , true , lambda { request.path =~ /(disabled|stars)/ } ],
20
+ [ :always_enabled_subtab , 'Always Enabled' , '/disabled/always_enabled' , true , true ],
21
+ [ :always_disabled_subtab , 'Always Disabled' , '/disabled/always_disabled' , true , false ],
22
+ #----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
23
+ # TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? #
24
+ #----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
25
+ ]
26
+
27
+ config.actions = [
28
+ #-----------------------------------------------------------------------------------------#
29
+ # CONTROLLER | ACTION | TAB #
30
+ #-----------------------------------------------------------------------------------------#
31
+ [ :home , :all_actions , :home_tab ],
32
+ [ :elliptical_galaxies , :all_actions , :elliptical_galaxies_subtab ],
33
+ [ :spiral_galaxies , :all_actions , :spiral_galaxies_subtab ],
34
+ [ :lenticular_galaxies , :all_actions , :lenticular_galaxies_subtab ],
35
+ [ :exoplanets , :all_actions , :exoplanets_subtab ],
36
+ [ :rogue_planets , :all_actions , :rogue_planets_subtab ],
37
+ [ :stars , :all_actions , :stars_tab ],
38
+ [ :misc , :always_visible , :always_visible_subtab ],
39
+ [ :misc , :always_hidden , :always_hidden_subtab ],
40
+ [ :misc , :always_enabled , :always_enabled_subtab ],
41
+ [ :misc , :always_disabled , :always_disabled_subtab ],
42
+ #-----------------------------------------------------------------------------------------#
43
+ # CONTROLLER | ACTION | TAB #
44
+ #-----------------------------------------------------------------------------------------#
45
+ ]
46
+
47
+ config.css.scaffolding = true
48
+ config.css.background_color = '#cec'
49
+ config.css.text_color = '#464'
50
+ config.css.active_tab_color = '#fff'
51
+ config.css.hover_tab_color = '#dfd'
52
+ config.css.inactive_tab_color = '#aca'
53
+ config.css.inactive_text_color = '#8a8'
54
+
55
+ end
@@ -0,0 +1,102 @@
1
+ Tabulous.setup do |config|
2
+
3
+ config.tabs = [
4
+
5
+ #----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
6
+
7
+ # TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? #
8
+
9
+ #----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
10
+
11
+ [ :home_tab , 'Explanation' , '/' , true , true ],
12
+ [ :galaxies_tab , 'Galaxies' , '/galaxies/elliptical_galaxies' , true , true ],
13
+
14
+
15
+ [ :elliptical_galaxies_subtab , 'Elliptical Galaxies' , '/galaxies/elliptical_galaxies' , true , true ],
16
+ [ :spiral_galaxies_subtab , 'Spiral Galaxies' , '/galaxies/spiral_galaxies' , true , true ],
17
+
18
+
19
+
20
+ [ :lenticular_galaxies_subtab , 'Lenticular Galaxies' , '/galaxies/lenticular_galaxies' , true , true ],
21
+ [ :planets_tab , 'Planets' , '/exoplanets' , true , true ],
22
+ [ :exoplanets_subtab , 'Exoplanets' , '/exoplanets' , true , true ],
23
+
24
+
25
+
26
+
27
+ [ :rogue_planets_subtab , 'Rogue Planets' , '/rogue_planets' , true , true ],
28
+ [ :stars_tab , 'Stars' , '/stars' , true , true ],
29
+ [ :hidden_tab , 'Hidden' , '/hidden/always_visible' , lambda { request.path =~ /(hidden|galaxies)/ } , true ],
30
+ [ :always_visible_subtab , 'Always Visible' , '/hidden/always_visible' , true , true ],
31
+ [ :always_hidden_subtab , 'Always Hidden' , '/hidden/always_hidden' , false , true ],
32
+ [ :disabled_tab , 'Disabled' , '/disabled/always_enabled' , true , lambda { request.path =~ /(disabled|stars)/ } ],
33
+ [ :always_enabled_subtab , 'Always Enabled' , '/disabled/always_enabled' , true , true ],
34
+ [ :always_disabled_subtab , 'Always Disabled' , '/disabled/always_disabled' , true , false ],
35
+
36
+
37
+ #----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
38
+
39
+
40
+
41
+ # TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? #
42
+
43
+
44
+
45
+ #----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
46
+
47
+
48
+
49
+ ]
50
+
51
+ config.actions = [
52
+
53
+
54
+
55
+
56
+
57
+ #-----------------------------------------------------------------------------------------#
58
+
59
+ # CONTROLLER | ACTION | TAB #
60
+
61
+
62
+ #-----------------------------------------------------------------------------------------#
63
+
64
+ [ :home , :all_actions , :home_tab ],
65
+ [ :elliptical_galaxies , :all_actions , :elliptical_galaxies_subtab ],
66
+ [ :spiral_galaxies , :all_actions , :spiral_galaxies_subtab ],
67
+ [ :lenticular_galaxies , :all_actions , :lenticular_galaxies_subtab ],
68
+ [ :exoplanets , :all_actions , :exoplanets_subtab ],
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+ [ :rogue_planets , :all_actions , :rogue_planets_subtab ],
77
+
78
+ [ :stars , :all_actions , :stars_tab ],
79
+
80
+ [ :misc , :always_visible , :always_visible_subtab ],
81
+
82
+ [ :misc , :always_hidden , :always_hidden_subtab ],
83
+ [ :misc , :always_enabled , :always_enabled_subtab ],
84
+ [ :misc , :always_disabled , :always_disabled_subtab ],
85
+ #-----------------------------------------------------------------------------------------#
86
+
87
+
88
+
89
+ # CONTROLLER | ACTION | TAB #
90
+
91
+ #-----------------------------------------------------------------------------------------#
92
+ ]
93
+
94
+ config.css.scaffolding = true
95
+ config.css.background_color = '#cec'
96
+ config.css.text_color = '#464'
97
+ config.css.active_tab_color = '#fff'
98
+ config.css.hover_tab_color = '#dfd'
99
+ config.css.inactive_tab_color = '#aca'
100
+ config.css.inactive_text_color = '#8a8'
101
+
102
+ end
@@ -0,0 +1,144 @@
1
+ Of The Distress of Arjuna
2
+
3
+ Dhritirashtra. Ranged thus for battle on the sacred plain-
4
+ On Kurukshetra- say, Sanjaya! say
5
+ What wrought my people, and the Pandavas?
6
+ Sanjaya. When he beheld the host of Pandavas,
7
+ Raja Duryodhana to Drona drew,
8
+ And spake these words: "Ah, Guru! see this line,
9
+ How vast it is of Pandu fighting-men,
10
+ Embattled by the son of Drupada,
11
+ Thy scholar in the war! Therein stand ranked
12
+ Chiefs like Arjuna, like to Bhima chiefs,
13
+ Benders of bows; Virata, Yuyudhan,
14
+ Drupada, eminent upon his car,
15
+ Dhrishtaket, Chekitan, Kasi's stout lord,
16
+ Purujit, Kuntibhoj, and Saivya,
17
+ With Yudhamanyu, and Uttamauj
18
+ Subhadra's child; and Drupadi's;- all famed!
19
+ All mounted on their shining chariots!
20
+ On our side, too,- thou best of Brahmans! see
21
+ Excellent chiefs, commanders of my line,
22
+ Whose names I joy to count: thyself the first,
23
+ Then Bhishma, Karna, Kripa fierce in fight,
24
+ Vikarna, Aswatthaman; next to these
25
+ Strong Saumadatti, with full many more
26
+ Valiant and tried, ready this day to die
27
+ For me their king, each with his weapon grasped,
28
+ Each skilful in the field. Weakest- meseems-
29
+ Our battle shows where Bhishma holds command,
30
+ And Bhima, fronting him, something too strong!
31
+ Have care our captains nigh to Bhishma's ranks
32
+ Prepare what help they may! Now, blow my shell!"
33
+
34
+
35
+ Then, at the signal of the aged king,
36
+ With blare to wake the blood, rolling around
37
+ Like to a lion's roar, the trumpeter
38
+ Blew the great Conch; and, at the noise of it,
39
+ Trumpets and drums, cymbals and gongs and horns
40
+ Burst into sudden clamour; as the blasts
41
+ Of loosened tempest, such the tumult seemed!
42
+ Then might be seen, upon their car of gold
43
+ Yoked with white steeds, blowing their battle-shells,
44
+ Krishna the God, Arjuna at his side:
45
+ Krishna, with knotted locks, blew his great conch
46
+ Carved of the "Giant's bone;" Arjuna blew
47
+ Indra's loud gift; Bhima the terrible-
48
+ Wolf-bellied Bhima- blew a long reed-conch;
49
+ And Yudhisthira, Kunti's blameless son,
50
+ Winded a mighty shell, "Victory's Voice;"
51
+ And Nakula blew shrill upon his conch
52
+ Named the "Sweet-sounding," Sahadev on his
53
+ Called "Gem-bedecked," and Kasi's Prince on his.
54
+ Sikhandi on his car, Dhrishtadyumn,
55
+ Virata, Satyaki the Unsubdued,
56
+ Drupada, with his sons, (O Lord of Earth!)
57
+ Long-armed Subhadra's children, all blew loud,
58
+ So that the clangour shook their foemen's hearts,
59
+ With quaking earth and thundering heav'n.
60
+ Then 'twas-
61
+ Beholding Dhritirashtra's battle set,
62
+ Weapons unsheathing, bows drawn forth, the war
63
+ Instant to break- Arjun, whose ensign-badge
64
+ Was Hanuman the monkey, spake this thing
65
+ To Krishna the Divine, his charioteer:
66
+ "Drive, Dauntless One! to yonder open ground
67
+ Betwixt the armies; I would see more nigh
68
+ These who will fight with us, those we must slay
69
+ To-day, in war's arbitrament; for, sure,
70
+ On bloodshed all are bent who throng this plain,
71
+ Obeying Dhritirashtra's sinful son."
72
+
73
+
74
+ Thus, by Arjuna prayed, (O Bharata!)
75
+ Between the hosts that heavenly Charioteer
76
+ Drove the bright car, reining its milk-white steeds
77
+ Where Bhishma led, and Drona, and their Lords.
78
+ "See!" spake he to Arjuna, "where they stand,
79
+ Thy kindred of the Kurus:" and the Prince
80
+ Marked on each hand the kinsmen of his house,
81
+ Grandsires and sires, uncles and brothers and sons,
82
+ Cousins and sons-in-law and nephews, mixed
83
+ With friends and honoured elders; some this side,
84
+ Some that side ranged: and, seeing those opposed,
85
+ Such kith grown enemies- Arjuna's heart
86
+ Melted with pity, while he uttered this:
87
+ Arjuna. Krishna! as I behold, come here to shed
88
+ Their common blood, yon concourse of our kin,
89
+ My members fail, my tongue dries in my mouth,
90
+ A shudder thrills my body, and my hair
91
+ Bristles with horror; from my weak hand slips
92
+ Gandiv, the goodly bow; a fever burns
93
+ My skin to parching; hardly may I stand;
94
+ The life within me seems to swim and faint;
95
+ Nothing do I foresee save woe and wail!
96
+ It is not good, O Keshav! nought of good
97
+ Can spring from mutual slaughter! Lo, I hate
98
+ Triumph and domination, wealth and ease,
99
+ Thus sadly won! Aho! what victory
100
+ Can bring delight, Govinda! what rich spoils
101
+ Could profit; what rule recompense; what span
102
+ Of life itself seem sweet, bought with such blood?
103
+ Seeing that these stand here, ready to die,
104
+ For whose sake life was fair, and pleasure pleased,
105
+ And power grew precious:- grandsires, sires, and sons,
106
+ Brothers, and fathers-in-law, and sons-in-law,
107
+ Elders and friends! Shall I deal death on these
108
+ Even though they seek to slay us? Not one blow,
109
+ O Madhusudan! will I strike to gain
110
+ The rule of all Three Worlds; then, how much less
111
+ To seize an earthly kingdom! Killing these
112
+ Must breed but anguish, Krishna! If they be
113
+ Guilty, we shall grow guilty by their deaths;
114
+ Their sins will light on us, if we shall slay
115
+ Those sons of Dhritirashtra, and our kin;
116
+ What peace could come of that, O Madhava?
117
+ For if indeed, blinded by lust and wrath,
118
+ These cannot see, or will not see, the sin
119
+ Of kingly lines o'erthrown and kinsmen slain,
120
+ How should not we, who see, shun such a crime-
121
+ We who perceive the guilt and feel the shame-
122
+ O thou Delight of Men, Janardana?
123
+ By overthrow of houses perisheth
124
+ Their sweet continuous household piety,
125
+ And- rites neglected, piety extinct-
126
+ Enters impiety upon that home;
127
+ Its women grow unwomaned, whence there spring
128
+ Mad passions, and the mingling-up of castes,
129
+ Sending a Hell-ward road that family,
130
+ And whoso wrought its doom by wicked wrath.
131
+ Nay, and the souls of honoured ancestors
132
+ Fall from their place of peace, being bereft
133
+ Of funeral-cakes and the wan death-water.
134
+ So teach our holy hymns. Thus, if we slay
135
+ Kinsfolk and friends for love of earthly power,
136
+ Ahovat! what an evil fault it were!
137
+ Better I deem it, if my kinsmen strike,
138
+ To face them weaponless, and bare my breast
139
+ To shaft and spear, than answer blow with blow.
140
+
141
+
142
+ So speaking, in the face of those two hosts,
143
+ Arjuna sank upon his chariot-seat,
144
+ And let fall bow and arrows, sick at heart.
@@ -0,0 +1,55 @@
1
+ Tabulous.setup do |config|
2
+
3
+ config.tabs = [ # this comment should be preserved and not otherwise affect anything
4
+ #----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
5
+ # TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? #
6
+ #----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
7
+ [ :home_tab , 'Explanation' , '/' , true , true ], # this comment should be preserved and not otherwise affect anything
8
+ [ :galaxies_tab , 'Galaxies' , '/galaxies/elliptical_galaxies' , true , true ],
9
+ [ :elliptical_galaxies_subtab , 'Elliptical Galaxies' , '/galaxies/elliptical_galaxies' , true , true ],
10
+ [ :spiral_galaxies_subtab , 'Spiral Galaxies' , '/galaxies/spiral_galaxies' , true , true ],
11
+ [ :lenticular_galaxies_subtab , 'Lenticular Galaxies' , '/galaxies/lenticular_galaxies' , true , true ],
12
+ [ :planets_tab , 'Planets' , '/exoplanets' , true , true ], # this comment should be preserved and not otherwise affect anything
13
+ [ :exoplanets_subtab , 'Exoplanets' , '/exoplanets' , true , true ],
14
+ [ :rogue_planets_subtab , 'Rogue Planets' , '/rogue_planets' , true , true ],
15
+ [ :stars_tab , 'Stars' , '/stars' , true , true ],
16
+ [ :hidden_tab , 'Hidden' , '/hidden/always_visible' , lambda { request.path =~ /(hidden|galaxies)/ } , true ],
17
+ [ :always_visible_subtab , 'Always Visible' , '/hidden/always_visible' , true , true ],
18
+ [ :always_hidden_subtab , 'Always Hidden' , '/hidden/always_hidden' , false , true ],
19
+ [ :disabled_tab , 'Disabled' , '/disabled/always_enabled' , true , lambda { request.path =~ /(disabled|stars)/ } ],
20
+ [ :always_enabled_subtab , 'Always Enabled' , '/disabled/always_enabled' , true , true ],
21
+ [ :always_disabled_subtab , 'Always Disabled' , '/disabled/always_disabled' , true , false ], # this comment should be preserved and not otherwise affect anything
22
+ #----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
23
+ # TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? #
24
+ #----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
25
+ ] # this comment should be preserved and not otherwise affect anything
26
+
27
+ config.actions = [ # this comment should be preserved and not otherwise affect anything
28
+ #-----------------------------------------------------------------------------------------#
29
+ # CONTROLLER | ACTION | TAB #
30
+ #-----------------------------------------------------------------------------------------#
31
+ [ :home , :all_actions , :home_tab ], # this comment should be preserved and not otherwise affect anything
32
+ [ :elliptical_galaxies , :all_actions , :elliptical_galaxies_subtab ],
33
+ [ :spiral_galaxies , :all_actions , :spiral_galaxies_subtab ],
34
+ [ :lenticular_galaxies , :all_actions , :lenticular_galaxies_subtab ],
35
+ [ :exoplanets , :all_actions , :exoplanets_subtab ],
36
+ [ :rogue_planets , :all_actions , :rogue_planets_subtab ], # this comment should be preserved and not otherwise affect anything
37
+ [ :stars , :all_actions , :stars_tab ],
38
+ [ :misc , :always_visible , :always_visible_subtab ],
39
+ [ :misc , :always_hidden , :always_hidden_subtab ],
40
+ [ :misc , :always_enabled , :always_enabled_subtab ],
41
+ [ :misc , :always_disabled , :always_disabled_subtab ],
42
+ #-----------------------------------------------------------------------------------------#
43
+ # CONTROLLER | ACTION | TAB #
44
+ #-----------------------------------------------------------------------------------------#
45
+ ] # this comment should be preserved and not otherwise affect anything
46
+
47
+ config.css.scaffolding = true
48
+ config.css.background_color = '#cec'
49
+ config.css.text_color = '#464'
50
+ config.css.active_tab_color = '#fff'
51
+ config.css.hover_tab_color = '#dfd'
52
+ config.css.inactive_tab_color = '#aca'
53
+ config.css.inactive_text_color = '#8a8'
54
+
55
+ end
@@ -0,0 +1,13 @@
1
+ $:.unshift(File.expand_path(File.dirname(__FILE__) + "/../lib"))
2
+ require 'rubygems'
3
+ require 'test/unit'
4
+ require 'redgreen' unless RUBY_VERSION >= "1.9"
5
+ require 'diffy'
6
+
7
+ module Test
8
+ module Unit
9
+ class TestCase
10
+ # put shared unit test code here
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,69 @@
1
+ require File.expand_path('../unit_test_helper', File.dirname(__FILE__))
2
+ require 'tabulous/formatter'
3
+
4
+ class TabulousFormatterTest < Test::Unit::TestCase
5
+
6
+ # expected and actual are arrays of strings; they represent the
7
+ # before and after contents of a text file that has been run
8
+ # through TabulousFormatter
9
+ def assert_same_text(expected, actual)
10
+ # remove trailing whitespace as it doesn't matter for the purposes of diffing
11
+ expected = expected.map(&:rstrip)
12
+ actual = actual.map(&:rstrip)
13
+ # now make one big string out of the array of strings
14
+ expected = expected.join("\n")
15
+ actual = actual.join("\n")
16
+ message = Diffy::Diff.new(expected, actual).to_s(:color)
17
+ assert_block(message) { expected == actual }
18
+ end
19
+
20
+ def test_returns_array_of_strings
21
+ result = Tabulous::Formatter.format(['foo', 'bar'])
22
+ assert_kind_of Array, result
23
+ for element in result
24
+ assert_kind_of String, element
25
+ end
26
+ end
27
+
28
+ def test_empty_in_empty_out
29
+ input = IO.readlines('test/test_initializers/empty')
30
+ result = Tabulous::Formatter.format(input)
31
+ assert_equal [], result
32
+ end
33
+
34
+ def test_text_in_text_out
35
+ input = IO.readlines('test/test_initializers/text')
36
+ expected = input
37
+ actual = Tabulous::Formatter.format(input)
38
+ assert_same_text expected, actual
39
+ end
40
+
41
+ def test_well_formatted_in_well_formatted_out
42
+ input = IO.readlines('test/test_initializers/expected')
43
+ expected = input
44
+ actual = Tabulous::Formatter.format(input)
45
+ assert_same_text expected, actual
46
+ end
47
+
48
+ def test_random_horizontal_whitespace
49
+ input = IO.readlines('test/test_initializers/random_horizontal_whitespace')
50
+ expected = IO.readlines('test/test_initializers/expected')
51
+ actual = Tabulous::Formatter.format(input)
52
+ assert_same_text expected, actual
53
+ end
54
+
55
+ def test_random_vertical_whitespace
56
+ input = IO.readlines('test/test_initializers/random_vertical_whitespace')
57
+ expected = IO.readlines('test/test_initializers/expected')
58
+ actual = Tabulous::Formatter.format(input)
59
+ assert_same_text expected, actual
60
+ end
61
+
62
+ def test_trailing_comments
63
+ input = IO.readlines('test/test_initializers/trailing_comments')
64
+ expected = input
65
+ actual = Tabulous::Formatter.format(input)
66
+ assert_same_text expected, actual
67
+ end
68
+
69
+ end