picolena 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (390) hide show
  1. data/History.txt +11 -4
  2. data/Manifest.txt +1 -0
  3. data/README.txt +2 -2
  4. data/bin/picolena +1 -1
  5. data/config/hoe.rb +10 -10
  6. data/lib/picolena/USAGE +1 -1
  7. data/lib/picolena/config/basic.rb +11 -11
  8. data/lib/picolena/picolena_generator.rb +15 -14
  9. data/lib/picolena/templates/app/controllers/application.rb +5 -5
  10. data/lib/picolena/templates/app/controllers/documents_controller.rb +17 -9
  11. data/lib/picolena/templates/app/helpers/documents_helper.rb +15 -14
  12. data/lib/picolena/templates/app/models/document.rb +28 -37
  13. data/lib/picolena/templates/app/models/finder.rb +12 -37
  14. data/lib/picolena/templates/app/models/indexer.rb +58 -37
  15. data/lib/picolena/templates/app/models/plain_text_extractor.rb +16 -16
  16. data/lib/picolena/templates/app/models/query.rb +5 -5
  17. data/lib/picolena/templates/app/views/documents/show.html.haml +3 -3
  18. data/lib/picolena/templates/app/views/layouts/application.html.haml +2 -2
  19. data/lib/picolena/templates/config/environment.rb +1 -1
  20. data/lib/picolena/templates/config/initializers/002_load_indexed_dirs.rb +8 -8
  21. data/lib/picolena/templates/config/initializers/003_load_white_list_IPs.rb +8 -8
  22. data/lib/picolena/templates/config/initializers/005_load_custom_title_and_names_and_links.rb +5 -5
  23. data/lib/picolena/templates/config/initializers/006_load_icons.rb +9 -7
  24. data/lib/picolena/templates/lang/ui/es.yml +1 -1
  25. data/lib/picolena/templates/lib/core_exts.rb +7 -7
  26. data/lib/picolena/templates/lib/plain_text_extractor_DSL.rb +10 -10
  27. data/lib/picolena/templates/lib/plain_text_extractors/ms.excel.rb +1 -1
  28. data/lib/picolena/templates/lib/plain_text_extractors/plain_text.rb +2 -2
  29. data/lib/picolena/templates/lib/tasks/index.rake +8 -3
  30. data/lib/picolena/templates/lib/tasks/install_dependencies.rake +2 -2
  31. data/lib/picolena/templates/lib/tasks/log.rake +1 -1
  32. data/lib/picolena/templates/public/.htaccess +3 -3
  33. data/lib/picolena/templates/public/images/flags/sv.png +0 -0
  34. data/lib/picolena/templates/public/stylesheets/style.css +2 -2
  35. data/lib/picolena/templates/script/spec_server +1 -1
  36. data/lib/picolena/templates/spec/controllers/application_controller_spec.rb +2 -2
  37. data/lib/picolena/templates/spec/controllers/documents_controller_spec.rb +17 -17
  38. data/lib/picolena/templates/spec/helpers/application_helper_spec.rb +2 -2
  39. data/lib/picolena/templates/spec/helpers/documents_helper_spec.rb +3 -3
  40. data/lib/picolena/templates/spec/models/basic_finder_spec.rb +14 -14
  41. data/lib/picolena/templates/spec/models/document_spec.rb +7 -15
  42. data/lib/picolena/templates/spec/models/finder_spec.rb +45 -38
  43. data/lib/picolena/templates/spec/models/host_indexing_system_spec.rb +5 -5
  44. data/lib/picolena/templates/spec/models/index_directories_spec.rb +2 -2
  45. data/lib/picolena/templates/spec/models/plain_text_extractor_spec.rb +6 -6
  46. data/lib/picolena/templates/spec/models/query_spec.rb +7 -7
  47. data/lib/picolena/templates/spec/rcov.opts +1 -1
  48. data/lib/picolena/templates/spec/test_dirs/indexed/basic/myfirstjavaprog.java +1 -1
  49. data/lib/picolena/templates/spec/test_dirs/indexed/basic/queens.for +1 -1
  50. data/lib/picolena/templates/spec/test_dirs/indexed/lang/hugo +74 -74
  51. data/lib/picolena/templates/spec/test_dirs/indexed/lang/lorca +56 -56
  52. data/lib/picolena/templates/spec/test_dirs/indexed/others/7.html +4 -4
  53. data/lib/picolena/templates/spec/test_dirs/indexed/others/ccmatrix1.cpp +6 -6
  54. data/lib/picolena/templates/spec/test_dirs/indexed/others/lemonde.htm +326 -326
  55. data/lib/picolena/templates/spec/test_dirs/indexed/others/nested/ReadMe.rtf +62 -62
  56. data/lib/picolena/templates/spec/test_dirs/indexed/others/xor.vee +0 -1
  57. data/lib/picolena/templates/spec/test_dirs/indexed/others/zafh.net.html +1 -1
  58. data/lib/picolena/version.rb +1 -1
  59. data/lib/rubigen_ext.rb +1 -1
  60. data/rails_plugins/globalite/CHANGELOG +1 -1
  61. data/rails_plugins/globalite/README +19 -19
  62. data/rails_plugins/globalite/lang/rails/de-DE.yml +6 -6
  63. data/rails_plugins/globalite/lang/rails/en-UK.yml +10 -10
  64. data/rails_plugins/globalite/lang/rails/en-US.yml +10 -10
  65. data/rails_plugins/globalite/lang/rails/es-ES.yml +11 -11
  66. data/rails_plugins/globalite/lang/rails/fr-FR.yml +10 -10
  67. data/rails_plugins/globalite/lang/rails/it.yml +10 -10
  68. data/rails_plugins/globalite/lang/rails/pt-BR.yml +6 -6
  69. data/rails_plugins/globalite/lang/rails/pt-PT.yml +6 -6
  70. data/rails_plugins/globalite/lib/globalite/l10n.rb +25 -25
  71. data/rails_plugins/globalite/lib/globalite/locale.rb +9 -9
  72. data/rails_plugins/globalite/lib/rails/core_ext.rb +4 -4
  73. data/rails_plugins/globalite/lib/rails/localization.rb +3 -3
  74. data/rails_plugins/globalite/lib/rails/localized_action_view.rb +17 -17
  75. data/rails_plugins/globalite/lib/rails/localized_active_record.rb +4 -4
  76. data/rails_plugins/globalite/rdoc/classes/ActionView/Helpers/DateHelper.html +19 -19
  77. data/rails_plugins/globalite/rdoc/classes/ActionView/Helpers/FormOptionsHelper.html +9 -9
  78. data/rails_plugins/globalite/rdoc/classes/ActionView/Helpers/NumberHelper.html +8 -8
  79. data/rails_plugins/globalite/rdoc/classes/ActionView/Helpers.html +5 -5
  80. data/rails_plugins/globalite/rdoc/classes/ActionView.html +5 -5
  81. data/rails_plugins/globalite/rdoc/classes/ActiveRecord/Errors.html +6 -6
  82. data/rails_plugins/globalite/rdoc/classes/ActiveRecord.html +5 -5
  83. data/rails_plugins/globalite/rdoc/classes/Array.html +6 -6
  84. data/rails_plugins/globalite/rdoc/classes/Date.html +8 -8
  85. data/rails_plugins/globalite/rdoc/classes/Globalite/L10n.html +49 -49
  86. data/rails_plugins/globalite/rdoc/classes/Globalite.html +6 -6
  87. data/rails_plugins/globalite/rdoc/classes/Kernel.html +6 -6
  88. data/rails_plugins/globalite/rdoc/classes/Locale.html +11 -11
  89. data/rails_plugins/globalite/rdoc/classes/Time.html +8 -8
  90. data/rails_plugins/globalite/rdoc/files/README.html +5 -5
  91. data/rails_plugins/globalite/rdoc/files/lib/globalite/l10n_rb.html +5 -5
  92. data/rails_plugins/globalite/rdoc/files/lib/globalite/locale_rb.html +5 -5
  93. data/rails_plugins/globalite/rdoc/files/lib/globalite_rb.html +5 -5
  94. data/rails_plugins/globalite/rdoc/files/lib/rails/core_ext_rb.html +5 -5
  95. data/rails_plugins/globalite/rdoc/files/lib/rails/localization_rb.html +5 -5
  96. data/rails_plugins/globalite/rdoc/files/lib/rails/localized_action_view_rb.html +5 -5
  97. data/rails_plugins/globalite/rdoc/files/lib/rails/localized_active_record_rb.html +5 -5
  98. data/rails_plugins/globalite/rdoc/fr_class_index.html +1 -1
  99. data/rails_plugins/globalite/rdoc/fr_file_index.html +1 -1
  100. data/rails_plugins/globalite/rdoc/fr_method_index.html +1 -1
  101. data/rails_plugins/globalite/rdoc/index.html +1 -1
  102. data/rails_plugins/globalite/spec/core_localization_spec.rb +18 -18
  103. data/rails_plugins/globalite/spec/l10n_spec.rb +25 -25
  104. data/rails_plugins/globalite/tasks/globalite_tasks.rake +6 -6
  105. data/rails_plugins/rspec/CHANGES +16 -16
  106. data/rails_plugins/rspec/README +2 -2
  107. data/rails_plugins/rspec/Rakefile +1 -1
  108. data/rails_plugins/rspec/UPGRADE +1 -1
  109. data/rails_plugins/rspec/autotest/discover.rb +1 -1
  110. data/rails_plugins/rspec/examples/pure/autogenerated_docstrings_example.rb +5 -5
  111. data/rails_plugins/rspec/examples/pure/before_and_after_example.rb +2 -2
  112. data/rails_plugins/rspec/examples/pure/behave_as_example.rb +5 -5
  113. data/rails_plugins/rspec/examples/pure/custom_expectation_matchers.rb +7 -7
  114. data/rails_plugins/rspec/examples/pure/file_accessor.rb +1 -1
  115. data/rails_plugins/rspec/examples/pure/file_accessor_spec.rb +2 -2
  116. data/rails_plugins/rspec/examples/pure/helper_method_example.rb +1 -1
  117. data/rails_plugins/rspec/examples/pure/legacy_spec.rb +2 -2
  118. data/rails_plugins/rspec/examples/pure/predicate_example.rb +2 -2
  119. data/rails_plugins/rspec/examples/pure/shared_example_group_example.rb +11 -11
  120. data/rails_plugins/rspec/examples/pure/shared_stack_examples.rb +4 -4
  121. data/rails_plugins/rspec/examples/pure/stack.rb +6 -6
  122. data/rails_plugins/rspec/examples/pure/stack_spec.rb +7 -7
  123. data/rails_plugins/rspec/examples/pure/stack_spec_with_nested_example_groups.rb +10 -10
  124. data/rails_plugins/rspec/examples/pure/stubbing_example.rb +4 -4
  125. data/rails_plugins/rspec/examples/stories/adder.rb +2 -2
  126. data/rails_plugins/rspec/examples/stories/addition +8 -8
  127. data/rails_plugins/rspec/examples/stories/calculator.rb +5 -5
  128. data/rails_plugins/rspec/examples/stories/game-of-life/behaviour/examples/game_behaviour.rb +7 -7
  129. data/rails_plugins/rspec/examples/stories/game-of-life/behaviour/examples/grid_behaviour.rb +13 -13
  130. data/rails_plugins/rspec/examples/stories/game-of-life/behaviour/stories/create_a_cell.rb +5 -5
  131. data/rails_plugins/rspec/examples/stories/game-of-life/behaviour/stories/kill_a_cell.rb +2 -2
  132. data/rails_plugins/rspec/examples/stories/game-of-life/life/game.rb +3 -3
  133. data/rails_plugins/rspec/examples/stories/game-of-life/life/grid.rb +10 -10
  134. data/rails_plugins/rspec/failing_examples/failing_autogenerated_docstrings_example.rb +5 -5
  135. data/rails_plugins/rspec/failing_examples/failure_in_setup.rb +3 -3
  136. data/rails_plugins/rspec/failing_examples/failure_in_teardown.rb +3 -3
  137. data/rails_plugins/rspec/failing_examples/mocking_example.rb +1 -1
  138. data/rails_plugins/rspec/failing_examples/raising_example.rb +11 -11
  139. data/rails_plugins/rspec/failing_examples/team_spec.rb +5 -5
  140. data/rails_plugins/rspec/lib/autotest/rspec.rb +5 -5
  141. data/rails_plugins/rspec/lib/spec/example/configuration.rb +4 -4
  142. data/rails_plugins/rspec/lib/spec/example/example_group_factory.rb +3 -3
  143. data/rails_plugins/rspec/lib/spec/example/example_group_methods.rb +1 -1
  144. data/rails_plugins/rspec/lib/spec/example/example_matcher.rb +2 -2
  145. data/rails_plugins/rspec/lib/spec/example/example_methods.rb +4 -4
  146. data/rails_plugins/rspec/lib/spec/example/pending.rb +1 -1
  147. data/rails_plugins/rspec/lib/spec/expectations/differs/default.rb +5 -5
  148. data/rails_plugins/rspec/lib/spec/expectations/errors.rb +1 -1
  149. data/rails_plugins/rspec/lib/spec/expectations/handler.rb +5 -5
  150. data/rails_plugins/rspec/lib/spec/expectations.rb +1 -1
  151. data/rails_plugins/rspec/lib/spec/extensions/main.rb +8 -8
  152. data/rails_plugins/rspec/lib/spec/interop/test/unit/ui/console/testrunner.rb +2 -2
  153. data/rails_plugins/rspec/lib/spec/matchers/be.rb +18 -18
  154. data/rails_plugins/rspec/lib/spec/matchers/be_close.rb +4 -4
  155. data/rails_plugins/rspec/lib/spec/matchers/change.rb +20 -20
  156. data/rails_plugins/rspec/lib/spec/matchers/eql.rb +4 -4
  157. data/rails_plugins/rspec/lib/spec/matchers/equal.rb +4 -4
  158. data/rails_plugins/rspec/lib/spec/matchers/has.rb +8 -8
  159. data/rails_plugins/rspec/lib/spec/matchers/have.rb +9 -9
  160. data/rails_plugins/rspec/lib/spec/matchers/include.rb +7 -7
  161. data/rails_plugins/rspec/lib/spec/matchers/match.rb +6 -6
  162. data/rails_plugins/rspec/lib/spec/matchers/operator_matcher.rb +1 -1
  163. data/rails_plugins/rspec/lib/spec/matchers/raise_error.rb +6 -6
  164. data/rails_plugins/rspec/lib/spec/matchers/respond_to.rb +7 -7
  165. data/rails_plugins/rspec/lib/spec/matchers/satisfy.rb +4 -4
  166. data/rails_plugins/rspec/lib/spec/matchers/simple_matcher.rb +3 -3
  167. data/rails_plugins/rspec/lib/spec/matchers/throw_symbol.rb +8 -8
  168. data/rails_plugins/rspec/lib/spec/matchers.rb +2 -2
  169. data/rails_plugins/rspec/lib/spec/mocks/argument_constraint_matchers.rb +3 -3
  170. data/rails_plugins/rspec/lib/spec/mocks/argument_expectation.rb +32 -32
  171. data/rails_plugins/rspec/lib/spec/mocks/error_generator.rb +13 -13
  172. data/rails_plugins/rspec/lib/spec/mocks/errors.rb +1 -1
  173. data/rails_plugins/rspec/lib/spec/mocks/message_expectation.rb +38 -38
  174. data/rails_plugins/rspec/lib/spec/mocks/methods.rb +3 -3
  175. data/rails_plugins/rspec/lib/spec/mocks/mock.rb +5 -5
  176. data/rails_plugins/rspec/lib/spec/mocks/order_group.rb +5 -5
  177. data/rails_plugins/rspec/lib/spec/mocks/proxy.rb +4 -4
  178. data/rails_plugins/rspec/lib/spec/mocks/space.rb +3 -3
  179. data/rails_plugins/rspec/lib/spec/mocks/spec_methods.rb +1 -1
  180. data/rails_plugins/rspec/lib/spec/mocks.rb +13 -13
  181. data/rails_plugins/rspec/lib/spec/rake/spectask.rb +4 -4
  182. data/rails_plugins/rspec/lib/spec/rake/verify_rcov.rb +9 -9
  183. data/rails_plugins/rspec/lib/spec/runner/backtrace_tweaker.rb +2 -2
  184. data/rails_plugins/rspec/lib/spec/runner/formatter/base_formatter.rb +7 -7
  185. data/rails_plugins/rspec/lib/spec/runner/formatter/base_text_formatter.rb +13 -13
  186. data/rails_plugins/rspec/lib/spec/runner/formatter/failing_examples_formatter.rb +1 -1
  187. data/rails_plugins/rspec/lib/spec/runner/formatter/html_formatter.rb +8 -8
  188. data/rails_plugins/rspec/lib/spec/runner/formatter/profile_formatter.rb +7 -7
  189. data/rails_plugins/rspec/lib/spec/runner/formatter/progress_bar_formatter.rb +2 -2
  190. data/rails_plugins/rspec/lib/spec/runner/formatter/snippet_extractor.rb +5 -5
  191. data/rails_plugins/rspec/lib/spec/runner/formatter/specdoc_formatter.rb +4 -4
  192. data/rails_plugins/rspec/lib/spec/runner/formatter/story/html_formatter.rb +6 -6
  193. data/rails_plugins/rspec/lib/spec/runner/formatter/story/plain_text_formatter.rb +12 -12
  194. data/rails_plugins/rspec/lib/spec/runner/heckle_runner.rb +6 -6
  195. data/rails_plugins/rspec/lib/spec/runner/option_parser.rb +5 -5
  196. data/rails_plugins/rspec/lib/spec/runner/options.rb +8 -8
  197. data/rails_plugins/rspec/lib/spec/runner/reporter.rb +14 -14
  198. data/rails_plugins/rspec/lib/spec/runner.rb +41 -41
  199. data/rails_plugins/rspec/lib/spec/story/extensions/main.rb +6 -6
  200. data/rails_plugins/rspec/lib/spec/story/extensions/regexp.rb +1 -1
  201. data/rails_plugins/rspec/lib/spec/story/extensions/string.rb +1 -1
  202. data/rails_plugins/rspec/lib/spec/story/given_scenario.rb +1 -1
  203. data/rails_plugins/rspec/lib/spec/story/runner/plain_text_story_runner.rb +6 -6
  204. data/rails_plugins/rspec/lib/spec/story/runner/scenario_collector.rb +2 -2
  205. data/rails_plugins/rspec/lib/spec/story/runner/scenario_runner.rb +5 -5
  206. data/rails_plugins/rspec/lib/spec/story/runner/story_mediator.rb +20 -20
  207. data/rails_plugins/rspec/lib/spec/story/runner/story_parser.rb +29 -29
  208. data/rails_plugins/rspec/lib/spec/story/runner/story_runner.rb +8 -8
  209. data/rails_plugins/rspec/lib/spec/story/runner.rb +7 -7
  210. data/rails_plugins/rspec/lib/spec/story/scenario.rb +1 -1
  211. data/rails_plugins/rspec/lib/spec/story/step.rb +5 -5
  212. data/rails_plugins/rspec/lib/spec/story/step_group.rb +12 -12
  213. data/rails_plugins/rspec/lib/spec/story/step_mother.rb +6 -6
  214. data/rails_plugins/rspec/lib/spec/story/story.rb +5 -5
  215. data/rails_plugins/rspec/lib/spec/story/world.rb +16 -16
  216. data/rails_plugins/rspec/lib/spec/translator.rb +21 -21
  217. data/rails_plugins/rspec/lib/spec/version.rb +2 -2
  218. data/rails_plugins/rspec/lib/spec.rb +1 -1
  219. data/rails_plugins/rspec/pre_commit/lib/pre_commit/pre_commit.rb +1 -1
  220. data/rails_plugins/rspec/pre_commit/lib/pre_commit/rspec.rb +6 -6
  221. data/rails_plugins/rspec/pre_commit/lib/pre_commit/rspec_on_rails.rb +6 -6
  222. data/rails_plugins/rspec/pre_commit/spec/pre_commit/pre_commit_spec.rb +1 -1
  223. data/rails_plugins/rspec/pre_commit/spec/pre_commit/rspec_on_rails_spec.rb +1 -1
  224. data/rails_plugins/rspec/report.html +3 -3
  225. data/rails_plugins/rspec/spec/autotest/discover_spec.rb +2 -2
  226. data/rails_plugins/rspec/spec/autotest/rspec_spec.rb +30 -30
  227. data/rails_plugins/rspec/spec/autotest_matchers.rb +7 -7
  228. data/rails_plugins/rspec/spec/spec/example/configuration_spec.rb +5 -5
  229. data/rails_plugins/rspec/spec/spec/example/example_group_factory_spec.rb +5 -5
  230. data/rails_plugins/rspec/spec/spec/example/example_group_methods_spec.rb +3 -3
  231. data/rails_plugins/rspec/spec/spec/example/example_group_spec.rb +2 -2
  232. data/rails_plugins/rspec/spec/spec/example/example_matcher_spec.rb +10 -10
  233. data/rails_plugins/rspec/spec/spec/example/example_runner_spec.rb +29 -29
  234. data/rails_plugins/rspec/spec/spec/example/example_spec.rb +6 -6
  235. data/rails_plugins/rspec/spec/spec/example/nested_example_group_spec.rb +2 -2
  236. data/rails_plugins/rspec/spec/spec/example/pending_module_spec.rb +3 -3
  237. data/rails_plugins/rspec/spec/spec/example/predicate_matcher_spec.rb +1 -1
  238. data/rails_plugins/rspec/spec/spec/example/shared_example_group_spec.rb +4 -4
  239. data/rails_plugins/rspec/spec/spec/expectations/extensions/object_spec.rb +12 -12
  240. data/rails_plugins/rspec/spec/spec/expectations/fail_with_spec.rb +8 -8
  241. data/rails_plugins/rspec/spec/spec/extensions/main_spec.rb +6 -6
  242. data/rails_plugins/rspec/spec/spec/interop/test/unit/spec_spec.rb +2 -2
  243. data/rails_plugins/rspec/spec/spec/interop/test/unit/test_unit_spec_helper.rb +2 -2
  244. data/rails_plugins/rspec/spec/spec/interop/test/unit/testcase_spec.rb +2 -2
  245. data/rails_plugins/rspec/spec/spec/matchers/be_spec.rb +5 -5
  246. data/rails_plugins/rspec/spec/spec/matchers/change_spec.rb +14 -14
  247. data/rails_plugins/rspec/spec/spec/matchers/description_generation_spec.rb +25 -25
  248. data/rails_plugins/rspec/spec/spec/matchers/exist_spec.rb +5 -5
  249. data/rails_plugins/rspec/spec/spec/matchers/handler_spec.rb +16 -16
  250. data/rails_plugins/rspec/spec/spec/matchers/have_spec.rb +13 -13
  251. data/rails_plugins/rspec/spec/spec/matchers/match_spec.rb +1 -1
  252. data/rails_plugins/rspec/spec/spec/matchers/matcher_methods_spec.rb +1 -1
  253. data/rails_plugins/rspec/spec/spec/matchers/operator_matcher_spec.rb +17 -17
  254. data/rails_plugins/rspec/spec/spec/matchers/raise_error_spec.rb +20 -20
  255. data/rails_plugins/rspec/spec/spec/matchers/respond_to_spec.rb +10 -10
  256. data/rails_plugins/rspec/spec/spec/matchers/simple_matcher_spec.rb +3 -3
  257. data/rails_plugins/rspec/spec/spec/matchers/throw_symbol_spec.rb +2 -2
  258. data/rails_plugins/rspec/spec/spec/mocks/any_number_of_times_spec.rb +2 -2
  259. data/rails_plugins/rspec/spec/spec/mocks/bug_report_10263.rb +3 -3
  260. data/rails_plugins/rspec/spec/spec/mocks/bug_report_11545_spec.rb +4 -4
  261. data/rails_plugins/rspec/spec/spec/mocks/bug_report_15719_spec.rb +1 -1
  262. data/rails_plugins/rspec/spec/spec/mocks/bug_report_7611_spec.rb +1 -1
  263. data/rails_plugins/rspec/spec/spec/mocks/bug_report_8302_spec.rb +1 -1
  264. data/rails_plugins/rspec/spec/spec/mocks/failing_mock_argument_constraints_spec.rb +12 -12
  265. data/rails_plugins/rspec/spec/spec/mocks/mock_ordering_spec.rb +3 -3
  266. data/rails_plugins/rspec/spec/spec/mocks/mock_space_spec.rb +1 -1
  267. data/rails_plugins/rspec/spec/spec/mocks/mock_spec.rb +56 -56
  268. data/rails_plugins/rspec/spec/spec/mocks/multiple_return_value_spec.rb +3 -3
  269. data/rails_plugins/rspec/spec/spec/mocks/once_counts_spec.rb +1 -1
  270. data/rails_plugins/rspec/spec/spec/mocks/options_hash_spec.rb +1 -1
  271. data/rails_plugins/rspec/spec/spec/mocks/partial_mock_spec.rb +16 -16
  272. data/rails_plugins/rspec/spec/spec/mocks/partial_mock_using_mocks_directly_spec.rb +10 -10
  273. data/rails_plugins/rspec/spec/spec/mocks/passing_mock_argument_constraints_spec.rb +13 -13
  274. data/rails_plugins/rspec/spec/spec/mocks/stub_spec.rb +7 -7
  275. data/rails_plugins/rspec/spec/spec/mocks/twice_counts_spec.rb +6 -6
  276. data/rails_plugins/rspec/spec/spec/package/bin_spec_spec.rb +1 -1
  277. data/rails_plugins/rspec/spec/spec/runner/class_and_argument_parser_spec.rb +2 -2
  278. data/rails_plugins/rspec/spec/spec/runner/command_line_spec.rb +1 -1
  279. data/rails_plugins/rspec/spec/spec/runner/drb_command_line_spec.rb +2 -2
  280. data/rails_plugins/rspec/spec/spec/runner/execution_context_spec.rb +2 -2
  281. data/rails_plugins/rspec/spec/spec/runner/formatter/failing_example_groups_formatter_spec.rb +2 -2
  282. data/rails_plugins/rspec/spec/spec/runner/formatter/html_formatted-1.8.4.html +1 -1
  283. data/rails_plugins/rspec/spec/spec/runner/formatter/html_formatted-1.8.5-jruby.html +2 -2
  284. data/rails_plugins/rspec/spec/spec/runner/formatter/html_formatted-1.8.5.html +1 -1
  285. data/rails_plugins/rspec/spec/spec/runner/formatter/html_formatted-1.8.6-jruby.html +1 -1
  286. data/rails_plugins/rspec/spec/spec/runner/formatter/html_formatted-1.8.6.html +3 -3
  287. data/rails_plugins/rspec/spec/spec/runner/formatter/html_formatter_spec.rb +1 -1
  288. data/rails_plugins/rspec/spec/spec/runner/formatter/profile_formatter_spec.rb +9 -9
  289. data/rails_plugins/rspec/spec/spec/runner/formatter/progress_bar_formatter_spec.rb +4 -4
  290. data/rails_plugins/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb +1 -1
  291. data/rails_plugins/rspec/spec/spec/runner/formatter/story/html_formatter_spec.rb +5 -5
  292. data/rails_plugins/rspec/spec/spec/runner/formatter/text_mate_formatted-1.8.4.html +13 -13
  293. data/rails_plugins/rspec/spec/spec/runner/formatter/text_mate_formatted-1.8.6.html +2 -2
  294. data/rails_plugins/rspec/spec/spec/runner/heckle_runner_spec.rb +1 -1
  295. data/rails_plugins/rspec/spec/spec/runner/noisy_backtrace_tweaker_spec.rb +3 -3
  296. data/rails_plugins/rspec/spec/spec/runner/option_parser_spec.rb +9 -9
  297. data/rails_plugins/rspec/spec/spec/runner/options_spec.rb +13 -13
  298. data/rails_plugins/rspec/spec/spec/runner/quiet_backtrace_tweaker_spec.rb +1 -1
  299. data/rails_plugins/rspec/spec/spec/spec_classes.rb +8 -8
  300. data/rails_plugins/rspec/spec/spec/story/builders.rb +7 -7
  301. data/rails_plugins/rspec/spec/spec/story/extensions/main_spec.rb +6 -6
  302. data/rails_plugins/rspec/spec/spec/story/given_scenario_spec.rb +3 -3
  303. data/rails_plugins/rspec/spec/spec/story/runner/plain_text_story_runner_spec.rb +12 -12
  304. data/rails_plugins/rspec/spec/spec/story/runner/scenario_collector_spec.rb +2 -2
  305. data/rails_plugins/rspec/spec/spec/story/runner/scenario_runner_spec.rb +21 -21
  306. data/rails_plugins/rspec/spec/spec/story/runner/story_mediator_spec.rb +22 -22
  307. data/rails_plugins/rspec/spec/spec/story/runner/story_parser_spec.rb +55 -55
  308. data/rails_plugins/rspec/spec/spec/story/runner/story_runner_spec.rb +44 -44
  309. data/rails_plugins/rspec/spec/spec/story/runner_spec.rb +18 -18
  310. data/rails_plugins/rspec/spec/spec/story/scenario_spec.rb +2 -2
  311. data/rails_plugins/rspec/spec/spec/story/step_group_spec.rb +20 -20
  312. data/rails_plugins/rspec/spec/spec/story/step_mother_spec.rb +14 -14
  313. data/rails_plugins/rspec/spec/spec/story/step_spec.rb +33 -33
  314. data/rails_plugins/rspec/spec/spec/story/story_spec.rb +12 -12
  315. data/rails_plugins/rspec/spec/spec/translator_spec.rb +12 -12
  316. data/rails_plugins/rspec/spec/spec_helper.rb +5 -5
  317. data/rails_plugins/rspec/stories/resources/helpers/story_helper.rb +1 -1
  318. data/rails_plugins/rspec/stories/resources/steps/running_rspec.rb +4 -4
  319. data/rails_plugins/rspec/stories/resources/test/spec_and_test_together.rb +2 -2
  320. data/rails_plugins/rspec/stories/resources/test/test_case_with_should_methods.rb +1 -1
  321. data/rails_plugins/rspec/story_server/prototype/javascripts/builder.js +14 -14
  322. data/rails_plugins/rspec/story_server/prototype/javascripts/controls.js +61 -61
  323. data/rails_plugins/rspec/story_server/prototype/javascripts/dragdrop.js +144 -144
  324. data/rails_plugins/rspec/story_server/prototype/javascripts/effects.js +127 -127
  325. data/rails_plugins/rspec/story_server/prototype/javascripts/rspec.js +15 -15
  326. data/rails_plugins/rspec/story_server/prototype/javascripts/scriptaculous.js +7 -7
  327. data/rails_plugins/rspec/story_server/prototype/javascripts/slider.js +37 -37
  328. data/rails_plugins/rspec/story_server/prototype/javascripts/sound.js +4 -4
  329. data/rails_plugins/rspec/story_server/prototype/javascripts/unittest.js +66 -66
  330. data/rails_plugins/rspec/story_server/prototype/stories.html +9 -9
  331. data/rails_plugins/rspec_on_rails/MIT-LICENSE +11 -11
  332. data/rails_plugins/rspec_on_rails/generators/rspec/templates/rcov.opts +1 -1
  333. data/rails_plugins/rspec_on_rails/generators/rspec/templates/script/spec_server +1 -1
  334. data/rails_plugins/rspec_on_rails/generators/rspec_controller/USAGE +1 -1
  335. data/rails_plugins/rspec_on_rails/generators/rspec_controller/templates/helper_spec.rb +2 -2
  336. data/rails_plugins/rspec_on_rails/generators/rspec_controller/templates/view_spec.rb +1 -1
  337. data/rails_plugins/rspec_on_rails/generators/rspec_scaffold/rspec_scaffold_generator.rb +12 -12
  338. data/rails_plugins/rspec_on_rails/generators/rspec_scaffold/templates/controller_spec.rb +35 -35
  339. data/rails_plugins/rspec_on_rails/generators/rspec_scaffold/templates/edit_erb_spec.rb +2 -2
  340. data/rails_plugins/rspec_on_rails/generators/rspec_scaffold/templates/helper_spec.rb +2 -2
  341. data/rails_plugins/rspec_on_rails/generators/rspec_scaffold/templates/index_erb_spec.rb +1 -1
  342. data/rails_plugins/rspec_on_rails/generators/rspec_scaffold/templates/new_erb_spec.rb +2 -2
  343. data/rails_plugins/rspec_on_rails/generators/rspec_scaffold/templates/routing_spec.rb +11 -11
  344. data/rails_plugins/rspec_on_rails/generators/rspec_scaffold/templates/show_erb_spec.rb +1 -1
  345. data/rails_plugins/rspec_on_rails/lib/autotest/rails_rspec.rb +3 -3
  346. data/rails_plugins/rspec_on_rails/lib/spec/rails/example/controller_example_group.rb +4 -4
  347. data/rails_plugins/rspec_on_rails/lib/spec/rails/example/rails_example_group.rb +1 -1
  348. data/rails_plugins/rspec_on_rails/lib/spec/rails/example/render_observer.rb +4 -4
  349. data/rails_plugins/rspec_on_rails/lib/spec/rails/example/view_example_group.rb +1 -1
  350. data/rails_plugins/rspec_on_rails/lib/spec/rails/extensions/action_controller/base.rb +1 -1
  351. data/rails_plugins/rspec_on_rails/lib/spec/rails/extensions/spec/matchers/have.rb +1 -1
  352. data/rails_plugins/rspec_on_rails/lib/spec/rails/matchers/assert_select.rb +10 -10
  353. data/rails_plugins/rspec_on_rails/lib/spec/rails/matchers/have_text.rb +6 -6
  354. data/rails_plugins/rspec_on_rails/lib/spec/rails/matchers/render_template.rb +7 -7
  355. data/rails_plugins/rspec_on_rails/lib/spec/rails/story_adapter.rb +1 -1
  356. data/rails_plugins/rspec_on_rails/lib/spec/rails.rb +8 -8
  357. data/rails_plugins/rspec_on_rails/spec/rails/autotest/mappings_spec.rb +6 -6
  358. data/rails_plugins/rspec_on_rails/spec/rails/example/controller_isolation_spec.rb +1 -1
  359. data/rails_plugins/rspec_on_rails/spec/rails/example/controller_spec_spec.rb +22 -22
  360. data/rails_plugins/rspec_on_rails/spec/rails/example/helper_spec_spec.rb +1 -1
  361. data/rails_plugins/rspec_on_rails/spec/rails/example/ivar_proxy_spec.rb +3 -3
  362. data/rails_plugins/rspec_on_rails/spec/rails/example/shared_behaviour_spec.rb +2 -2
  363. data/rails_plugins/rspec_on_rails/spec/rails/example/view_spec_spec.rb +8 -8
  364. data/rails_plugins/rspec_on_rails/spec/rails/extensions/action_view_base_spec.rb +7 -7
  365. data/rails_plugins/rspec_on_rails/spec/rails/extensions/active_record_spec.rb +1 -1
  366. data/rails_plugins/rspec_on_rails/spec/rails/matchers/assert_select_spec.rb +37 -37
  367. data/rails_plugins/rspec_on_rails/spec/rails/matchers/description_generation_spec.rb +1 -1
  368. data/rails_plugins/rspec_on_rails/spec/rails/matchers/have_text_spec.rb +4 -4
  369. data/rails_plugins/rspec_on_rails/spec/rails/matchers/redirect_to_spec.rb +26 -26
  370. data/rails_plugins/rspec_on_rails/spec/rails/matchers/render_spec.rb +18 -18
  371. data/rails_plugins/rspec_on_rails/spec/rails/mocks/mock_model_spec.rb +2 -2
  372. data/rails_plugins/rspec_on_rails/spec/spec_helper.rb +1 -1
  373. data/rails_plugins/rspec_on_rails/spec_resources/controllers/controller_spec_controller.rb +9 -9
  374. data/rails_plugins/rspec_on_rails/spec_resources/controllers/redirect_spec_controller.rb +7 -7
  375. data/rails_plugins/rspec_on_rails/spec_resources/controllers/render_spec_controller.rb +5 -5
  376. data/rails_plugins/rspec_on_rails/spec_resources/controllers/rjs_spec_controller.rb +10 -10
  377. data/rails_plugins/rspec_on_rails/spec_resources/helpers/explicit_helper.rb +1 -1
  378. data/rails_plugins/rspec_on_rails/stories/transactions_should_rollback.rb +1 -1
  379. data/rails_plugins/rspec_on_rails/tasks/rspec.rake +4 -4
  380. data/script/txt2html +1 -1
  381. data/setup.rb +4 -4
  382. data/tasks/hack.rake +3 -3
  383. data/website/index.html +2 -2
  384. data/website/index.txt +1 -1
  385. data/website/index_devjavu +3 -3
  386. data/website/javascripts/rounded_corners_lite.inc.js +1 -1
  387. data/website/stylesheets/screen.css +2 -2
  388. data.tar.gz.sig +0 -0
  389. metadata +2 -1
  390. metadata.gz.sig +2 -1
@@ -1,10 +1,10 @@
1
1
  desc 'Ferret index maintenance tasks'
2
- namespace :index do
2
+ namespace :index do
3
3
  desc 'Clear indexes'
4
4
  task :clear => :environment do
5
5
  Indexer.clear! :all
6
6
  end
7
-
7
+
8
8
  desc 'Create index'
9
9
  task :create => :environment do
10
10
  Indexer.index_every_directory(remove_first=true)
@@ -14,7 +14,12 @@ namespace :index do
14
14
  task :update => :environment do
15
15
  Indexer.index_every_directory
16
16
  end
17
-
17
+
18
+ desc 'Returns the number of indexed documents'
19
+ task :size => :environment do
20
+ puts "#{Indexer.doc_count} documents are currently indexed in #{Picolena::IndexSavePath}"
21
+ end
22
+
18
23
  # Search index with query "some query" :
19
24
  # rake index:search query="some query"
20
25
  desc 'Search index'
@@ -14,14 +14,14 @@ namespace :install_dependencies do
14
14
  # odt2txt package not available on previous versions
15
15
  desc 'Install required packages on Ubuntu'
16
16
  task :on_ubuntu => :on_debian
17
-
17
+
18
18
  desc 'Install required gems and programs on Windows'
19
19
  task :on_windows_xp do
20
20
  #NOTE: Long way to go before it runs on XP.
21
21
  $stderr.puts "Implement me!"
22
22
  end
23
23
 
24
- desc 'Install required gems and packages on Mac Os'
24
+ desc 'Install required gems and packages on Mac Os'
25
25
  task :on_mac_os do
26
26
  $stderr.puts "Implement me!"
27
27
  end
@@ -1,6 +1,6 @@
1
1
  desc 'Ferret index maintenance tasks'
2
2
 
3
- namespace :log do
3
+ namespace :log do
4
4
  desc 'Parse log files for queries'
5
5
  task :queries do
6
6
  show_action_regexp=/Processing DocumentsController#show \(for ([\d\.]+) at ([\d\- :]+)\) \[GET\]/
@@ -5,14 +5,14 @@ Options +FollowSymLinks +ExecCGI
5
5
 
6
6
  # If you don't want Rails to look in certain directories,
7
7
  # use the following rewrite rules so that Apache won't rewrite certain requests
8
- #
8
+ #
9
9
  # Example:
10
10
  # RewriteCond %{REQUEST_URI} ^/notrails.*
11
11
  # RewriteRule .* - [L]
12
12
 
13
13
  # Redirect all requests not available on the filesystem to Rails
14
14
  # By default the cgi dispatcher is used which is very slow
15
- #
15
+ #
16
16
  # For better performance replace the dispatcher with the fastcgi one
17
17
  #
18
18
  # Example:
@@ -33,7 +33,7 @@ RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
33
33
 
34
34
  # In case Rails experiences terminal errors
35
35
  # Instead of displaying this message you can supply a file here which will be rendered instead
36
- #
36
+ #
37
37
  # Example:
38
38
  # ErrorDocument 500 /500.html
39
39
 
@@ -96,14 +96,14 @@ h1, h2, h3, h4, h5, h6, p, form {
96
96
  border-left-color:#696;
97
97
  border-right-color:#363;
98
98
  border-bottom-color:#363;}
99
-
99
+
100
100
  #mainimg input.btn:hover{
101
101
  color:#EE8907;}
102
102
 
103
103
  #mainimg input.text_field{
104
104
  border: 2px solid #88b000;
105
105
  background: #fff;
106
- margin-right: 5px;
106
+ margin-right: 5px;
107
107
  }
108
108
 
109
109
  #contentarea hr {
@@ -23,7 +23,7 @@ module Spec
23
23
  active_connections.delete(name)
24
24
  end
25
25
  end
26
- end
26
+ end
27
27
 
28
28
  if ActionController.const_defined?(:Dispatcher)
29
29
  dispatcher = ::ActionController::Dispatcher.new($stdout)
@@ -5,12 +5,12 @@ describe ApplicationController do
5
5
  get 'access_denied'
6
6
  response.headers["Status"].should == "403 Forbidden"
7
7
  end
8
-
8
+
9
9
  it "should render 'Access denied' text when denying access" do
10
10
  get 'access_denied'
11
11
  response.body.should == 'Access denied'
12
12
  end
13
-
13
+
14
14
  it "should flash a warning if given a wrong request" do
15
15
  get 'unknown_request'
16
16
  response.should be_redirect
@@ -2,11 +2,11 @@ require File.dirname(__FILE__) + '/../spec_helper'
2
2
 
3
3
  describe "DocumentsController called from unknown IP" do
4
4
  controller_name "documents"
5
-
5
+
6
6
  before(:all) do
7
7
  @backup=Picolena::WhiteListIPs
8
8
  end
9
-
9
+
10
10
  it "should deny access" do
11
11
  # Displays a warning otherwise
12
12
  Picolena.send(:remove_const, :WhiteListIPs) && Picolena::WhiteListIPs=/Something that won't match/
@@ -23,75 +23,75 @@ describe "DocumentsController called from unknown IP" do
23
23
  end
24
24
  end
25
25
 
26
- describe DocumentsController do
26
+ describe DocumentsController do
27
27
  it "GET 'index' should be succesful" do
28
28
  get 'index'
29
29
  response.should be_success
30
30
  end
31
-
31
+
32
32
  it "POST 'check_query' should check query and redirect to show" do
33
33
  post 'check_query', {:query => 'basic test'}
34
34
  response.should be_redirect
35
- response.should redirect_to(document_url('basic test'))
35
+ response.should redirect_to(document_url('basic test'))
36
36
  end
37
-
37
+
38
38
  it "POST 'check_query' should accept . and redirect to show" do
39
39
  post 'check_query', {:query => 'basic.test'}
40
40
  response.should be_redirect
41
41
  response.should redirect_to(:action=>'show', :id=>'basic.test')
42
42
  end
43
-
43
+
44
44
  it "POST 'check_query' should accept ? and redirect to show" do
45
45
  post 'check_query', {:query => '?ric'}
46
46
  response.should be_redirect
47
- response.should redirect_to(:action=>'show', :id=>'?ric')
47
+ response.should redirect_to(:action=>'show', :id=>'?ric')
48
48
  end
49
-
49
+
50
50
  it "POST 'check_query' should accept empty query but should redirect to index" do
51
51
  post 'check_query', {:query => ''}
52
52
  response.should be_redirect
53
53
  response.should redirect_to(:action=>'index')
54
54
  end
55
-
55
+
56
56
  it "GET 'show' should find corresponding docs" do
57
57
  get 'show', :id=>'forschung an fachhochschulen nachhaltige energietechnik'
58
58
  response.should be_success
59
59
  assigns[:matching_documents].any?{|doc| doc.filename=="zafh.net.html"}.should be_true
60
60
  end
61
-
61
+
62
62
  it "GET 'show' should accept * in queries" do
63
63
  lambda{get 'show', :id=>'*ric'}.should_not raise_error
64
64
  response.should be_success
65
65
  assigns[:matching_documents].entries.should_not be_empty
66
66
  assigns[:matching_documents].any?{|doc| doc.matching_content.join.starts_with?("<<Éric>> Mößer\n\n\f")}.should be_true
67
67
  end
68
-
68
+
69
69
  it "GET 'show' should accept ? in queries" do
70
70
  lambda{get 'show', :id=>'?ric'}.should_not raise_error(ActionController::RoutingError)
71
71
  response.should be_success
72
72
  assigns[:matching_documents].entries.should_not be_empty
73
73
  assigns[:matching_documents].any?{|doc| doc.filename=="basic.tex"}.should be_true
74
74
  end
75
-
75
+
76
76
  it "GET 'show' should accept . in queries" do
77
77
  lambda{get 'show', :id=>'basic.pdf'}.should_not raise_error(ActionController::RoutingError)
78
78
  response.should be_success
79
79
  assigns[:matching_documents].entries.should_not be_empty
80
80
  assigns[:matching_documents].any?{|doc| doc.matching_content.join.starts_with?("just another content test in a pdf file")}.should be_true
81
81
  end
82
-
82
+
83
83
  it "GET 'show' should accept combined queries" do
84
84
  get 'show', :id=>'test filetype:pdf'
85
85
  response.should be_success
86
86
  assigns[:matching_documents].entries.should_not be_empty
87
87
  end
88
-
88
+
89
89
  it "GET 'show' should accept empty query but should redirect to index" do
90
90
  lambda{get 'show', :id=>''}.should_not raise_error
91
91
  response.should be_success
92
92
  assigns[:matching_documents].entries.should be_empty
93
93
  end
94
-
94
+
95
95
  it "GET 'download' should be successful with correct ID" do
96
96
  get 'show', :id=>'basic.pdf'
97
97
  response.should be_success
@@ -101,7 +101,7 @@ describe DocumentsController do
101
101
  assigns[:document].complete_path == d.complete_path
102
102
  response.should be_success
103
103
  end
104
-
104
+
105
105
  it "GET 'download' should redirect if wrong id" do
106
106
  probably_unique_id="Not a document".base26_hash
107
107
  get 'download', :id=>probably_unique_id
@@ -1,11 +1,11 @@
1
1
  require File.dirname(__FILE__) + '/../spec_helper'
2
2
 
3
3
  describe ApplicationHelper do
4
-
4
+
5
5
  #Delete this example and add some real ones or delete this file
6
6
  it "should include the ApplicationHelper" do
7
7
  included_modules = self.metaclass.send :included_modules
8
8
  included_modules.should include(ApplicationHelper)
9
9
  end
10
-
10
+
11
11
  end
@@ -1,11 +1,11 @@
1
1
  require File.dirname(__FILE__) + '/../spec_helper'
2
2
 
3
- describe DocumentsHelper do
3
+ describe DocumentsHelper do
4
4
  it "shouldn't raise if matching not in content field"
5
5
 
6
6
  PlainTextExtractor.supported_extensions.each{|ext|
7
- it "should have an icon for .#{ext} filetype" do
8
- icon_for(ext.to_s).should_not be_nil
7
+ it "should have an icon for .#{ext} filetype" do
8
+ icon_for(ext).should_not be_nil
9
9
  end
10
10
  }
11
11
  end
@@ -8,24 +8,24 @@ describe "Finder without index on disk" do
8
8
  @new_index_path=File.join(Dir::tmpdir,'ferret_tst')
9
9
  Picolena::IndexSavePath.replace(@new_index_path)
10
10
  end
11
-
11
+
12
12
  before(:each) do
13
13
  Indexer.clear!
14
14
  end
15
-
15
+
16
16
  it "should create index" do
17
17
  Picolena::IndexedDirectories.replace({'spec/test_dirs/indexed/just_one_doc'=>'//justonedoc/'})
18
18
  lambda {@finder_with_new_index=Finder.new("test moi")}.should change(Indexer, :index_exists?).from(false).to(true)
19
19
  File.exists?(File.join(@new_index_path,'_0.cfs')).should be_true
20
20
  Indexer.index.size.should >0
21
21
  end
22
-
22
+
23
23
  it "should raise if index is still empty after trying to create it" do
24
24
  Picolena::IndexedDirectories.replace({'spec/test_dirs/empty_folder'=>'//empty_folder/'})
25
25
  lambda {Finder.new("doesn't matter anyway")}.should raise_error(IndexError, "no document found")
26
26
  File.exists?(File.join(@new_index_path,'_0.cfs')).should be_false
27
27
  end
28
-
28
+
29
29
  after(:all) do
30
30
  Picolena::IndexedDirectories.replace(@original_indexed_dirs)
31
31
  Picolena::IndexSavePath.replace(@original_index_path)
@@ -45,11 +45,11 @@ fields={
45
45
  :language => :language
46
46
  }
47
47
 
48
- describe "Basic Finder" do
48
+ describe "Basic Finder" do
49
49
  before(:all) do
50
50
  Indexer.index_every_directory(remove_first=true)
51
51
  end
52
-
52
+
53
53
  it "should accept one parameter as query, and 2 optionals for paginating" do
54
54
  lambda {Finder.new}.should raise_error(ArgumentError, "wrong number of arguments (0 for 1)")
55
55
  # show first page with 10 results per page
@@ -65,37 +65,37 @@ describe "Basic Finder" do
65
65
  it "should return matching documents if executed successfully" do
66
66
  finder_with_valid_query=Finder.new("district heating")
67
67
  finder_with_valid_query.should respond_to(:matching_documents)
68
-
68
+
69
69
  matching_documents=finder_with_valid_query.matching_documents
70
70
  matching_documents.should_not be_empty
71
-
71
+
72
72
  matching_documents_filenames=matching_documents.collect{|d| d.filename}
73
73
  matching_documents_filenames.should include("Simulation of district heating systems for evaluation of real-time control strategies.pdf")
74
74
  matching_documents_filenames.should include("Types of malfunction in DH substations.doc")
75
75
  end
76
-
76
+
77
77
  it "should know if it has been executed" do
78
78
  @finder=Finder.new("some query")
79
79
  lambda {@finder.execute!}.should change(@finder, :executed?).from(false).to(true)
80
80
  end
81
-
81
+
82
82
  it "should not warn anything if index is up to date"
83
-
83
+
84
84
  it "should warn if index is not up to date"
85
-
85
+
86
86
  fields.each_pair do |description,field_name|
87
87
  it "should index #{description} as :#{field_name}" do
88
88
  Indexer.index.field_infos[field_name].should be_an_instance_of(Ferret::Index::FieldInfo)
89
89
  end
90
90
  end
91
-
91
+
92
92
  it "should know how much time was needed for execution" do
93
93
  finder=Finder.new("yet another stupid query")
94
94
  finder.executed?.should be_nil
95
95
  finder.time_needed.should > 0
96
96
  finder.executed?.should be_true
97
97
  end
98
-
98
+
99
99
  it "should not need more than 100ms to find documents" do
100
100
  finder=Finder.new("district heating")
101
101
  finder.execute!
@@ -1,7 +1,6 @@
1
1
  require File.dirname(__FILE__) + '/../spec_helper'
2
2
 
3
3
  basic_pdf_attribute={
4
- :size=>9380,
5
4
  :dirname=>File.join(RAILS_ROOT, 'spec/test_dirs/indexed/basic'),
6
5
  :basename=>'basic',
7
6
  :complete_path=>File.join(RAILS_ROOT, '/spec/test_dirs/indexed/basic/basic.pdf'),
@@ -13,18 +12,18 @@ describe Document do
13
12
  before(:each) do
14
13
  @valid_random_doc=Document.find(:random) rescue Document.new("spec/test_dirs/indexed/basic/basic.pdf")
15
14
  end
16
-
15
+
17
16
  it "should be an existing file" do
18
17
  lambda {Document.new("/patapouf.txt")}.should raise_error(Errno::ENOENT)
19
18
  lambda {@valid_random_doc}.should_not raise_error
20
19
  lambda {Document.new("spec/test_dirs/not_indexed/Rakefile")}.should_not raise_error(Errno::ENOENT)
21
20
  end
22
-
21
+
23
22
  it "should belong to an indexed directory" do
24
23
  lambda {@valid_random_doc}.should_not raise_error
25
24
  lambda {Document.new("spec/test_dirs/not_indexed/Rakefile")}.should raise_error(ArgumentError, "required document is not in indexed directory")
26
25
  end
27
-
26
+
28
27
  basic_pdf_attribute.each{|attribute,expected_value|
29
28
  it "should know its #{attribute}" do
30
29
  @valid_random_doc.should respond_to(attribute)
@@ -32,31 +31,24 @@ describe Document do
32
31
  @basic_pdf.send(attribute).should == expected_value
33
32
  end
34
33
  }
35
-
36
- it "should know which user it belongs to, if specified" do
37
- @valid_random_doc.should respond_to(:user)
38
- @valid_random_doc.user.should be_nil
39
- @valid_random_doc.user="eric"
40
- @valid_random_doc.user.should == "eric"
41
- end
42
-
34
+
43
35
  it "should know its content" do
44
36
  another_doc=Document.new("spec/test_dirs/indexed/basic/plain.txt")
45
37
  another_doc.content.should == "just a content test\nin a txt file"
46
38
  end
47
-
39
+
48
40
  it "should know its alias_path" do
49
41
  @valid_random_doc.should respond_to(:alias_path)
50
42
  @valid_random_doc.alias_path.starts_with?("http://picolena.devjavu.com/browser/trunk/lib/picolena/templates/spec/test_dirs/indexed").should be_true
51
43
  end
52
-
44
+
53
45
  it "should let finder specify its score" do
54
46
  @valid_random_doc.should respond_to(:score)
55
47
  @valid_random_doc.score.should be_nil
56
48
  @valid_random_doc.score=25
57
49
  @valid_random_doc.score.should == 25
58
50
  end
59
-
51
+
60
52
  it "should let finder specify its matching content" do
61
53
  @valid_random_doc.should respond_to(:matching_content)
62
54
  @valid_random_doc.matching_content.should be_nil
@@ -3,9 +3,20 @@ require File.dirname(__FILE__) + '/../spec_helper'
3
3
  def revert_changes!(file,content)
4
4
  File.open(file,'w'){|might_have_been_modified|
5
5
  might_have_been_modified.write content
6
- }
6
+ }
7
7
  end
8
8
 
9
+
10
+ def matching_document_for(query)
11
+ # Returns matching document for any given query only if
12
+ # exactly one document is found.
13
+ # Specs don't pass otherwise.
14
+ matching_documents=Finder.new(query).matching_documents
15
+ matching_documents.size.should == 1
16
+ matching_documents.first
17
+ end
18
+
19
+
9
20
  describe Finder do
10
21
  before(:all) do
11
22
  # SVN doesn't like non-ascii filenames.
@@ -13,7 +24,7 @@ describe Finder do
13
24
 
14
25
  # To be sure this file has the right content
15
26
  revert_changes!("spec/test_dirs/indexed/others/placeholder.txt","Absorption and Adsorption cooling machines!!!")
16
-
27
+
17
28
  once_upon_a_time=Time.local(1982,2,16,20,42)
18
29
  a_bit_later=Time.local(1983,12,9,9)
19
30
  nineties=Time.local(1990)
@@ -23,84 +34,80 @@ describe Finder do
23
34
  File.utime(0, nineties, 'spec/test_dirs/indexed/others/placeholder.txt')
24
35
  Indexer.index_every_directory(remove_first=true)
25
36
  end
26
-
37
+
27
38
  it "should find documents according to their basename when specified with basename:query" do
28
39
  matching_documents_filename=Finder.new("basename:crossed").matching_documents.collect{|d| d.filename}
29
40
  matching_documents_filename.should include("crossed.txt")
30
41
  matching_documents_filename.should include("crossed.text")
31
42
  end
32
-
43
+
33
44
  it "should find documents according to their filename when specified with file:query or filename:query" do
34
45
  Finder.new("filename:crossed.text").matching_documents.collect{|d| d.content}.should include("txt inside!")
35
46
  Finder.new("file:crossed.txt").matching_documents.collect{|d| d.content}.should include("text inside!")
36
47
  end
37
-
48
+
38
49
  it "should find documents according to their extension when specified with filetype:query" do
39
50
  Finder.new("filetype:odt").matching_documents.should_not be_empty
40
51
  Finder.new("filetype:pdf").matching_documents.should_not be_empty
41
52
  end
42
-
53
+
43
54
  it "should find documents according to their filename/basename/filetype even when unspecified" do
44
55
  Finder.new("crossed.text").matching_documents.should_not be_empty
45
56
  Finder.new("html").matching_documents.collect{|d| d.filename}.should include("zafh.net.html")
46
57
  Finder.new("crossed").total_hits.should >= 2
47
58
  end
48
-
59
+
49
60
  it "should give a boost to basename, filename and filetype in index" do
50
61
  index=Indexer.index
51
62
  index.field_infos[:basename].boost.should > 1.0
52
63
  index.field_infos[:filename].boost.should > 1.0
53
64
  index.field_infos[:filetype].boost.should > 1.0
54
65
  end
55
-
66
+
56
67
  it "should also index unreadable files with known mimetypes" do
57
68
  Finder.new("unreadable.pdf").matching_documents.should_not be_empty
58
69
  Finder.new("too_small.doc").matching_documents.should_not be_empty
59
70
  end
60
-
71
+
61
72
  it "should also index files with unknown mimetypes" do
62
- Finder.new("filetype:xyz").matching_document.basename.should == "ghjopdfg"
63
- Finder.new("filetype:abc").matching_document.filename.should == "asfg.abc"
64
- Finder.new("unreadable.png").matching_document.size.should == 19696
65
- #Support for xls has been added meanwhile. The test is still valid though.
66
- Finder.new("table.xls").matching_document.size.should == 8704
73
+ matching_document_for("filetype:xyz").basename.should == "ghjopdfg"
74
+ matching_document_for("filetype:abc").filename.should == "asfg.abc"
67
75
  end
68
-
76
+
69
77
  it "should also index files with upper/mixed case extension" do
70
78
  Finder.new("filetype:pdf").matching_documents.entries.find{|doc| doc.filename=="other_basic.PDF"}.should_not be_nil
71
79
  Finder.new("filetype:doc").matching_documents.entries.find{|doc| doc.filename=="other_too_small.dOc"}.should_not be_nil
72
80
  end
73
-
81
+
74
82
  it "should also index content of files with upper/mixed case extension" do
75
83
  Finder.new("'just another content test\nin a pdf file'").matching_documents.entries.find{|doc| doc.filename=="other_basic.PDF"}.should_not be_nil
76
84
  end
77
-
85
+
78
86
  it "should also accept utf8 queries" do
79
87
  lambda{Finder.new("Éric Mößer")}.should_not raise_error
80
88
  end
81
-
89
+
82
90
  it "should find documents according to their utf8 content" do
83
- Finder.new("Éric Mößer ext:pdf").matching_document.basename.should == "utf8"
84
- Finder.new("no me hace daño").matching_document.size.should == 30
85
- Finder.new("Éric Mößer filetype:pdf").matching_document.filename.should == "utf8.pdf"
91
+ matching_document_for("Éric Mößer ext:pdf").basename.should == "utf8"
92
+ matching_document_for("no me hace daño").filename.should == "utf8.txt"
93
+ matching_document_for("Éric Mößer filetype:pdf").filename.should == "utf8.pdf"
86
94
  end
87
-
95
+
88
96
  it "should find documents according to their utf8 filenames" do
89
- Finder.new("bäñüßé").matching_document.content.should == "just to know if files are indexed with utf8 filenames"
97
+ matching_document_for("bäñüßé").content.should == "just to know if files are indexed with utf8 filenames"
90
98
  end
91
-
99
+
92
100
  it "should find documents according to their modification date" do
93
- #FIXME: Specs don't pass in /tmp folder. They do pass in any other directory, though. Why???
94
101
  Finder.new("date:<1982").matching_documents.should be_empty
95
- Finder.new("19831209*").matching_document.basename.should == "office2003-word-template"
96
- Finder.new("date:<1983").matching_document.filename.should == "basic.pdf"
97
- Finder.new("date:>=1989 AND date:<=1992").matching_document.filename.should == "placeholder.txt"
102
+ matching_document_for("19831209*").basename.should == "office2003-word-template"
103
+ matching_document_for("date:<1983").filename.should == "basic.pdf"
104
+ matching_document_for("date:>=1989 AND date:<=1992").filename.should == "placeholder.txt"
98
105
  end
99
106
 
100
107
  it "should not concatenate cells from xls file" do
101
108
  Finder.new("content:ABC").matching_documents.select{|doc| doc.extname==".xls"}.should be_empty
102
109
  end
103
-
110
+
104
111
  it "should not raise if an indexed document has been moved/deleted, but just ignore it" do
105
112
  @basic_dir='spec/test_dirs/indexed/basic/'
106
113
  @from=File.join(@basic_dir,'another_plain.text')
@@ -114,29 +121,29 @@ describe Finder do
114
121
  File.rename(@to,@from) if File.exists?(@to)
115
122
  end
116
123
  end
117
-
124
+
118
125
  it "should not index content of binary files"
119
-
126
+
120
127
  # Ferret sometimes SEGFAULT crashed with '*.pdf' queries
121
128
  it "should not crash while looking for *.pdf" do
122
129
  @finder=Finder.new("some query")
123
130
  lambda{@finder=Finder.new("*.pdf")}.should_not raise_error
124
131
  @finder.matching_documents.should_not be_empty
125
132
  end
126
-
133
+
127
134
  it "should use ? as placeholder" do
128
- Finder.new("A?sorption machines").matching_document.matching_content.should include("<<Absorption>> and <<Adsorption>> cooling <<machines>>!!!")
135
+ matching_document_for("A?sorption machines").matching_content.should include("<<Absorption>> and <<Adsorption>> cooling <<machines>>!!!")
129
136
  end
130
-
137
+
131
138
  it "should use * as placeholder" do
132
- results=Finder.new("A*ption machines").matching_document.matching_content.should include("<<Absorption>> and <<Adsorption>> cooling <<machines>>!!!")
139
+ results=matching_document_for("A*ption machines").matching_content.should include("<<Absorption>> and <<Adsorption>> cooling <<machines>>!!!")
133
140
  end
134
-
141
+
135
142
  it "should not index those stupid Thumbs.db files" do
136
143
  Finder.new("Thumbs.db").matching_documents.should be_empty
137
144
  Finder.new("filetype:db").matching_documents.should_not be_empty
138
145
  end
139
-
146
+
140
147
  it "should keep content cached" do
141
148
  filename = "spec/test_dirs/indexed/others/placeholder.txt"
142
149
  content_before = "Absorption and Adsorption cooling machines!!!"
@@ -148,7 +155,7 @@ describe Finder do
148
155
  some_doc.content.should_not == content_before
149
156
  some_doc.cached.should == content_before
150
157
  end
151
-
158
+
152
159
  after(:all) do
153
160
  revert_changes!("spec/test_dirs/indexed/others/placeholder.txt","Absorption and Adsorption cooling machines!!!")
154
161
  end
@@ -6,19 +6,19 @@ describe "Host indexing system" do
6
6
  IO.popen("which #{dependency}"){|i| i.read.should_not be_empty}
7
7
  end
8
8
  end
9
-
9
+
10
10
  it "should have a language guesser installed" do
11
11
  PlainTextExtractor.language_guesser.should_not be_nil
12
12
  end
13
-
13
+
14
14
  it "should know which IP addresses are allowed (config/custom/white_list_ip.yml)" do
15
15
  File.should be_readable('config/custom/white_list_ip.yml')
16
16
  end
17
-
17
+
18
18
  it "should know which directories are to be indexed (config/custom/indexed_directories.yml)" do
19
19
  File.should be_readable('config/custom/indexed_directories.yml')
20
20
  end
21
-
21
+
22
22
  it "should be able to calculate base26 hash from strings" do
23
23
  "test_dirs/indexed/010/decrepito.pdf".base26_hash(5).should == "rails"
24
24
  "test_dirs/indexed/migrations/000_restreins.rb".base26_hash(5).should == "ricou"
@@ -26,7 +26,7 @@ describe "Host indexing system" do
26
26
  "test_dirs/indexed/1148/plots.odt".base26_hash(8).should == "picolehn"
27
27
  "whatever.pdf".base26_hash(10).should == "bbuxhynait"
28
28
  end
29
-
29
+
30
30
  it "should not use too small a hash for Document#probably_unique_id" do
31
31
  Picolena::HashLength.should_not < 10
32
32
  end
@@ -4,11 +4,11 @@ describe "IndexedDirectories" do
4
4
  it "should be defined" do
5
5
  lambda {Picolena::IndexedDirectories}.should_not raise_error(NameError)
6
6
  end
7
-
7
+
8
8
  it "should not be empty" do
9
9
  Picolena::IndexedDirectories.should_not be_empty
10
10
  end
11
-
11
+
12
12
  it "should only contain existing directories" do
13
13
  Picolena::IndexedDirectories.keys.all?{|dir|
14
14
  File.should be_directory(dir)