Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Upgrade to rails 2.1 and rspec-rails

  • Loading branch information...
commit 4a5e3c1b424799343e576a69f02a0d21b343d83d 1 parent a8e3057
@xaviershay authored
Showing with 13,714 additions and 12,363 deletions.
  1. +132 −0 lib/tasks/rspec.rake
  2. +3 −0  script/autospec
  3. +18 −4 script/spec_server
  4. +2 −5 spec/spec.opts
  5. +9 −0 spec/spec_helper.rb
  6. +7 −0 vendor/plugins/rspec-rails/.gitignore
  7. +44 −0 vendor/plugins/rspec-rails/History.txt
  8. +151 −0 vendor/plugins/rspec-rails/Manifest.txt
  9. +81 −0 vendor/plugins/rspec-rails/README.txt
  10. +37 −0 vendor/plugins/rspec-rails/Rakefile
  11. +7 −0 vendor/plugins/rspec-rails/UPGRADE
  12. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/generators/rspec/CHANGES
  13. +40 −0 vendor/plugins/rspec-rails/generators/rspec/rspec_generator.rb
  14. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/generators/rspec/templates/all_stories.rb
  15. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/generators/rspec/templates/previous_failures.txt
  16. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/generators/rspec/templates/rcov.opts
  17. +132 −0 vendor/plugins/rspec-rails/generators/rspec/templates/rspec.rake
  18. +3 −0  vendor/plugins/rspec-rails/generators/rspec/templates/script/autospec
  19. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/generators/rspec/templates/script/spec
  20. +116 −0 vendor/plugins/rspec-rails/generators/rspec/templates/script/spec_server
  21. +4 −0 vendor/plugins/rspec-rails/generators/rspec/templates/spec.opts
  22. +47 −0 vendor/plugins/rspec-rails/generators/rspec/templates/spec_helper.rb
  23. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/generators/rspec/templates/stories_helper.rb
  24. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/generators/rspec_controller/USAGE
  25. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/generators/rspec_controller/rspec_controller_generator.rb
  26. +25 −0 vendor/plugins/rspec-rails/generators/rspec_controller/templates/controller_spec.rb
  27. +11 −0 vendor/plugins/rspec-rails/generators/rspec_controller/templates/helper_spec.rb
  28. +12 −0 vendor/plugins/rspec-rails/generators/rspec_controller/templates/view_spec.rb
  29. +19 −0 vendor/plugins/rspec-rails/generators/rspec_default_values.rb
  30. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/generators/rspec_model/USAGE
  31. +35 −0 vendor/plugins/rspec-rails/generators/rspec_model/rspec_model_generator.rb
  32. +15 −0 vendor/plugins/rspec-rails/generators/rspec_model/templates/model_spec.rb
  33. +154 −0 vendor/plugins/rspec-rails/generators/rspec_scaffold/rspec_scaffold_generator.rb
  34. +173 −0 vendor/plugins/rspec-rails/generators/rspec_scaffold/templates/controller_spec.rb
  35. +26 −0 vendor/plugins/rspec-rails/generators/rspec_scaffold/templates/edit_erb_spec.rb
  36. +11 −0 vendor/plugins/rspec-rails/generators/rspec_scaffold/templates/helper_spec.rb
  37. +27 −0 vendor/plugins/rspec-rails/generators/rspec_scaffold/templates/index_erb_spec.rb
  38. +26 −0 vendor/plugins/rspec-rails/generators/rspec_scaffold/templates/new_erb_spec.rb
  39. +59 −0 vendor/plugins/rspec-rails/generators/rspec_scaffold/templates/routing_spec.rb
  40. +23 −0 vendor/plugins/rspec-rails/generators/rspec_scaffold/templates/show_erb_spec.rb
  41. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/init.rb
  42. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/lib/autotest/discover.rb
  43. +76 −0 vendor/plugins/rspec-rails/lib/autotest/rails_rspec.rb
  44. +15 −0 vendor/plugins/rspec-rails/lib/spec/rails.rb
  45. +47 −0 vendor/plugins/rspec-rails/lib/spec/rails/example.rb
  46. +43 −0 vendor/plugins/rspec-rails/lib/spec/rails/example/assigns_hash_proxy.rb
  47. +282 −0 vendor/plugins/rspec-rails/lib/spec/rails/example/controller_example_group.rb
  48. +25 −0 vendor/plugins/rspec-rails/lib/spec/rails/example/cookies_proxy.rb
  49. +87 −0 vendor/plugins/rspec-rails/lib/spec/rails/example/functional_example_group.rb
  50. +166 −0 vendor/plugins/rspec-rails/lib/spec/rails/example/helper_example_group.rb
  51. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/lib/spec/rails/example/model_example_group.rb
  52. +33 −0 vendor/plugins/rspec-rails/lib/spec/rails/example/rails_example_group.rb
  53. +90 −0 vendor/plugins/rspec-rails/lib/spec/rails/example/render_observer.rb
  54. +183 −0 vendor/plugins/rspec-rails/lib/spec/rails/example/view_example_group.rb
  55. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/lib/spec/rails/extensions.rb
  56. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/lib/spec/rails/extensions/action_controller/base.rb
  57. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/lib/spec/rails/extensions/action_controller/rescue.rb
  58. 0  ...or/plugins/{rspec_on_rails → rspec-rails}/lib/spec/rails/extensions/action_controller/test_response.rb
  59. +31 −0 vendor/plugins/rspec-rails/lib/spec/rails/extensions/action_view/base.rb
  60. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/lib/spec/rails/extensions/active_record/base.rb
  61. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/lib/spec/rails/extensions/object.rb
  62. +71 −0 vendor/plugins/rspec-rails/lib/spec/rails/extensions/spec/example/configuration.rb
  63. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/lib/spec/rails/extensions/spec/matchers/have.rb
  64. +14 −0 vendor/plugins/rspec-rails/lib/spec/rails/interop/testcase.rb
  65. +30 −0 vendor/plugins/rspec-rails/lib/spec/rails/matchers.rb
  66. +131 −0 vendor/plugins/rspec-rails/lib/spec/rails/matchers/assert_select.rb
  67. +57 −0 vendor/plugins/rspec-rails/lib/spec/rails/matchers/have_text.rb
  68. +54 −0 vendor/plugins/rspec-rails/lib/spec/rails/matchers/include_text.rb
  69. +113 −0 vendor/plugins/rspec-rails/lib/spec/rails/matchers/redirect_to.rb
  70. +90 −0 vendor/plugins/rspec-rails/lib/spec/rails/matchers/render_template.rb
  71. +132 −0 vendor/plugins/rspec-rails/lib/spec/rails/mocks.rb
  72. +79 −0 vendor/plugins/rspec-rails/lib/spec/rails/story_adapter.rb
  73. +15 −0 vendor/plugins/rspec-rails/lib/spec/rails/version.rb
  74. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/spec/rails/autotest/mappings_spec.rb
  75. +65 −0 vendor/plugins/rspec-rails/spec/rails/example/assigns_hash_proxy_spec.rb
  76. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/spec/rails/example/configuration_spec.rb
  77. +62 −0 vendor/plugins/rspec-rails/spec/rails/example/controller_isolation_spec.rb
  78. +255 −0 vendor/plugins/rspec-rails/spec/rails/example/controller_spec_spec.rb
  79. +74 −0 vendor/plugins/rspec-rails/spec/rails/example/cookies_proxy_spec.rb
  80. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/spec/rails/example/example_group_factory_spec.rb
  81. +161 −0 vendor/plugins/rspec-rails/spec/rails/example/helper_spec_spec.rb
  82. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/spec/rails/example/model_spec_spec.rb
  83. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/spec/rails/example/shared_behaviour_spec.rb
  84. 0  ...or/plugins/{rspec_on_rails → rspec-rails}/spec/rails/example/test_unit_assertion_accessibility_spec.rb
  85. +268 −0 vendor/plugins/rspec-rails/spec/rails/example/view_spec_spec.rb
  86. 0  ...r/plugins/{rspec_on_rails → rspec-rails}/spec/rails/extensions/action_controller_rescue_action_spec.rb
  87. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/spec/rails/extensions/action_view_base_spec.rb
  88. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/spec/rails/extensions/active_record_spec.rb
  89. +66 −0 vendor/plugins/rspec-rails/spec/rails/interop/testcase_spec.rb
  90. +814 −0 vendor/plugins/rspec-rails/spec/rails/matchers/assert_select_spec.rb
  91. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/spec/rails/matchers/description_generation_spec.rb
  92. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/spec/rails/matchers/errors_on_spec.rb
  93. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/spec/rails/matchers/have_text_spec.rb
  94. +64 −0 vendor/plugins/rspec-rails/spec/rails/matchers/include_text_spec.rb
  95. +209 −0 vendor/plugins/rspec-rails/spec/rails/matchers/redirect_to_spec.rb
  96. +176 −0 vendor/plugins/rspec-rails/spec/rails/matchers/render_template_spec.rb
  97. +10 −0 vendor/plugins/rspec-rails/spec/rails/mocks/ar_classes.rb
  98. +90 −0 vendor/plugins/rspec-rails/spec/rails/mocks/mock_model_spec.rb
  99. +79 −0 vendor/plugins/rspec-rails/spec/rails/mocks/stub_model_spec.rb
  100. +8 −0 vendor/plugins/rspec-rails/spec/rails/sample_modified_fixture.rb
  101. +8 −0 vendor/plugins/rspec-rails/spec/rails/sample_spec.rb
  102. +96 −0 vendor/plugins/rspec-rails/spec/rails/spec_server_spec.rb
  103. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/spec/rails/spec_spec.rb
  104. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/spec/rails_suite.rb
  105. +57 −0 vendor/plugins/rspec-rails/spec/spec_helper.rb
  106. 0  .../plugins/{rspec_on_rails → rspec-rails}/spec_resources/controllers/action_view_base_spec_controller.rb
  107. +94 −0 vendor/plugins/rspec-rails/spec_resources/controllers/controller_spec_controller.rb
  108. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/spec_resources/controllers/redirect_spec_controller.rb
  109. +30 −0 vendor/plugins/rspec-rails/spec_resources/controllers/render_spec_controller.rb
  110. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/spec_resources/controllers/rjs_spec_controller.rb
  111. +38 −0 vendor/plugins/rspec-rails/spec_resources/helpers/explicit_helper.rb
  112. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/spec_resources/helpers/more_explicit_helper.rb
  113. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/spec_resources/helpers/plugin_application_helper.rb
  114. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/spec_resources/helpers/view_spec_helper.rb
  115. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/spec_resources/views/controller_spec/_partial.rhtml
  116. 0  ...ils → rspec-rails}/spec_resources/views/controller_spec/action_setting_flash_after_session_reset.rhtml
  117. 0  ...ls → rspec-rails}/spec_resources/views/controller_spec/action_setting_flash_before_session_reset.rhtml
  118. 0  ...pec_on_rails → rspec-rails}/spec_resources/views/controller_spec/action_setting_the_assigns_hash.rhtml
  119. 0  ...spec_on_rails → rspec-rails}/spec_resources/views/controller_spec/action_with_errors_in_template.rhtml
  120. 0  ...plugins/{rspec_on_rails → rspec-rails}/spec_resources/views/controller_spec/action_with_template.rhtml
  121. 0  ...t/plugin_with_no_lib_dir/init.rb → plugins/rspec-rails/spec_resources/views/layouts/application.rhtml}
  122. 0  ...sing_class/missing_class_generator.rb → plugins/rspec-rails/spec_resources/views/layouts/simple.rhtml}
  123. +1 −0  vendor/plugins/rspec-rails/spec_resources/views/objects/_object.html.erb
  124. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/spec_resources/views/render_spec/_a_partial.rhtml
  125. 0  ...h_url.rhtml → plugins/rspec-rails/spec_resources/views/render_spec/action_with_alternate_layout.rhtml}
  126. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/spec_resources/views/render_spec/some_action.js.rjs
  127. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/spec_resources/views/render_spec/some_action.rhtml
  128. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/spec_resources/views/render_spec/some_action.rjs
  129. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/spec_resources/views/rjs_spec/_replacement_partial.rhtml
  130. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/spec_resources/views/rjs_spec/hide_div.rjs
  131. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/spec_resources/views/rjs_spec/hide_page_element.rjs
  132. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/spec_resources/views/rjs_spec/insert_html.rjs
  133. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/spec_resources/views/rjs_spec/replace.rjs
  134. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/spec_resources/views/rjs_spec/replace_html.rjs
  135. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/spec_resources/views/rjs_spec/replace_html_with_partial.rjs
  136. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/spec_resources/views/rjs_spec/visual_effect.rjs
  137. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/spec_resources/views/rjs_spec/visual_toggle_effect.rjs
  138. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/spec_resources/views/tag_spec/no_tags.rhtml
  139. 0  ...ugins/{rspec_on_rails → rspec-rails}/spec_resources/views/tag_spec/single_div_with_no_attributes.rhtml
  140. 0  ...ugins/{rspec_on_rails → rspec-rails}/spec_resources/views/tag_spec/single_div_with_one_attribute.rhtml
  141. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/spec_resources/views/view_spec/_partial.rhtml
  142. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/spec_resources/views/view_spec/_partial_used_twice.rhtml
  143. 0  ...ugins/{rspec_on_rails → rspec-rails}/spec_resources/views/view_spec/_partial_with_local_variable.rhtml
  144. 0  .../plugins/{rspec_on_rails → rspec-rails}/spec_resources/views/view_spec/_partial_with_sub_partial.rhtml
  145. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/spec_resources/views/view_spec/_spacer.rhtml
  146. +5 −0 vendor/plugins/rspec-rails/spec_resources/views/view_spec/accessor.rhtml
  147. +3 −0  vendor/plugins/rspec-rails/spec_resources/views/view_spec/block_helper.rhtml
  148. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/spec_resources/views/view_spec/entry_form.rhtml
  149. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/spec_resources/views/view_spec/explicit_helper.rhtml
  150. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/spec_resources/views/view_spec/foo/show.rhtml
  151. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/spec_resources/views/view_spec/implicit_helper.rhtml
  152. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/spec_resources/views/view_spec/multiple_helpers.rhtml
  153. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/spec_resources/views/view_spec/template_with_partial.rhtml
  154. 0  ...ec_on_rails → rspec-rails}/spec_resources/views/view_spec/template_with_partial_using_collection.rhtml
  155. 0  ...s/{rspec_on_rails → rspec-rails}/spec_resources/views/view_spec/template_with_partial_with_array.rhtml
  156. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/stories/all.rb
  157. +5 −0 vendor/plugins/rspec-rails/stories/configuration/stories.rb
  158. +6 −0 vendor/plugins/rspec-rails/stories/helper.rb
  159. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/stories/steps/people.rb
  160. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/stories/transactions_should_rollback
  161. 0  vendor/plugins/{rspec_on_rails → rspec-rails}/stories/transactions_should_rollback.rb
  162. +0 −31 vendor/plugins/rspec_on_rails/MIT-LICENSE
  163. +0 −3  vendor/plugins/rspec_on_rails/README
  164. +0 −9 vendor/plugins/rspec_on_rails/Rakefile
  165. +0 −35 vendor/plugins/rspec_on_rails/generators/rspec/rspec_generator.rb
  166. +0 −102 vendor/plugins/rspec_on_rails/generators/rspec/templates/script/spec_server
  167. +0 −6 vendor/plugins/rspec_on_rails/generators/rspec/templates/spec.opts
  168. +0 −39 vendor/plugins/rspec_on_rails/generators/rspec/templates/spec_helper.rb
  169. +0 −25 vendor/plugins/rspec_on_rails/generators/rspec_controller/templates/controller_spec.rb
  170. +0 −11 vendor/plugins/rspec_on_rails/generators/rspec_controller/templates/helper_spec.rb
  171. +0 −12 vendor/plugins/rspec_on_rails/generators/rspec_controller/templates/view_spec.rb
  172. +0 −30 vendor/plugins/rspec_on_rails/generators/rspec_model/rspec_model_generator.rb
  173. +0 −11 vendor/plugins/rspec_on_rails/generators/rspec_model/templates/model_spec.rb
  174. +0 −167 vendor/plugins/rspec_on_rails/generators/rspec_scaffold/rspec_scaffold_generator.rb
  175. +0 −313 vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/controller_spec.rb
  176. +0 −25 vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/edit_erb_spec.rb
  177. +0 −11 vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/helper_spec.rb
  178. +0 −22 vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/index_erb_spec.rb
  179. +0 −26 vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/new_erb_spec.rb
  180. +0 −61 vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/routing_spec.rb
  181. +0 −22 vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/show_erb_spec.rb
  182. +0 −81 vendor/plugins/rspec_on_rails/lib/autotest/rails_rspec.rb
  183. +0 −51 vendor/plugins/rspec_on_rails/lib/spec/rails.rb
  184. +0 −47 vendor/plugins/rspec_on_rails/lib/spec/rails/example.rb
  185. +0 −42 vendor/plugins/rspec_on_rails/lib/spec/rails/example/assigns_hash_proxy.rb
  186. +0 −255 vendor/plugins/rspec_on_rails/lib/spec/rails/example/controller_example_group.rb
  187. +0 −66 vendor/plugins/rspec_on_rails/lib/spec/rails/example/functional_example_group.rb
  188. +0 −82 vendor/plugins/rspec_on_rails/lib/spec/rails/example/helper_example_group.rb
  189. +0 −62 vendor/plugins/rspec_on_rails/lib/spec/rails/example/ivar_proxy.rb
  190. +0 −68 vendor/plugins/rspec_on_rails/lib/spec/rails/example/rails_example_group.rb
  191. +0 −90 vendor/plugins/rspec_on_rails/lib/spec/rails/example/render_observer.rb
  192. +0 −171 vendor/plugins/rspec_on_rails/lib/spec/rails/example/view_example_group.rb
  193. +0 −27 vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/action_view/base.rb
  194. +0 −66 vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/spec/example/configuration.rb
  195. +0 −29 vendor/plugins/rspec_on_rails/lib/spec/rails/matchers.rb
  196. +0 −130 vendor/plugins/rspec_on_rails/lib/spec/rails/matchers/assert_select.rb
  197. +0 −55 vendor/plugins/rspec_on_rails/lib/spec/rails/matchers/have_text.rb
  198. +0 −113 vendor/plugins/rspec_on_rails/lib/spec/rails/matchers/redirect_to.rb
  199. +0 −70 vendor/plugins/rspec_on_rails/lib/spec/rails/matchers/render_template.rb
  200. +0 −71 vendor/plugins/rspec_on_rails/lib/spec/rails/story_adapter.rb
  201. +0 −23 vendor/plugins/rspec_on_rails/lib/spec/rails/version.rb
  202. +0 −8 vendor/plugins/rspec_on_rails/spec/rails/autotest/rails_rspec_spec.rb
  203. +0 −55 vendor/plugins/rspec_on_rails/spec/rails/example/assigns_hash_proxy_spec.rb
  204. +0 −43 vendor/plugins/rspec_on_rails/spec/rails/example/controller_isolation_spec.rb
  205. +0 −187 vendor/plugins/rspec_on_rails/spec/rails/example/controller_spec_spec.rb
  206. +0 −118 vendor/plugins/rspec_on_rails/spec/rails/example/helper_spec_spec.rb
  207. +0 −64 vendor/plugins/rspec_on_rails/spec/rails/example/ivar_proxy_spec.rb
  208. +0 −263 vendor/plugins/rspec_on_rails/spec/rails/example/view_spec_spec.rb
  209. +0 −783 vendor/plugins/rspec_on_rails/spec/rails/matchers/assert_select_spec.rb
  210. +0 −203 vendor/plugins/rspec_on_rails/spec/rails/matchers/redirect_to_spec.rb
  211. +0 −169 vendor/plugins/rspec_on_rails/spec/rails/matchers/render_spec.rb
  212. +0 −65 vendor/plugins/rspec_on_rails/spec/rails/mocks/mock_model_spec.rb
  213. +0 −7 vendor/plugins/rspec_on_rails/spec/rails/sample_spec.rb
  214. +0 −89 vendor/plugins/rspec_on_rails/spec/rails/spec_server_spec.rb
  215. +0 −46 vendor/plugins/rspec_on_rails/spec/spec_helper.rb
  216. +0 −56 vendor/plugins/rspec_on_rails/spec_resources/controllers/controller_spec_controller.rb
  217. +0 −26 vendor/plugins/rspec_on_rails/spec_resources/controllers/render_spec_controller.rb
  218. +0 −10 vendor/plugins/rspec_on_rails/spec_resources/helpers/explicit_helper.rb
  219. +0 −3  vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/accessor.rhtml
  220. +0 −5 vendor/plugins/rspec_on_rails/stories/helper.rb
  221. +0 −137 vendor/plugins/rspec_on_rails/tasks/rspec.rake
  222. 0  vendor/rails/REVISION_8540
  223. +7 −1 vendor/rails/actionmailer/CHANGELOG
  224. +1 −1  vendor/rails/actionmailer/MIT-LICENSE
  225. +14 −10 vendor/rails/actionmailer/README
  226. +3 −2 vendor/rails/actionmailer/Rakefile
  227. +1 −1  vendor/rails/actionmailer/lib/action_mailer.rb
  228. +143 −100 vendor/rails/actionmailer/lib/action_mailer/base.rb
  229. +7 −7 vendor/rails/actionmailer/lib/action_mailer/helpers.rb
  230. +2 −2 vendor/rails/actionmailer/lib/action_mailer/part.rb
  231. +3 −1 vendor/rails/actionmailer/lib/action_mailer/quoting.rb
  232. +14 −22 vendor/rails/actionmailer/lib/action_mailer/test_case.rb
  233. +2 −2 vendor/rails/actionmailer/lib/action_mailer/vendor.rb
  234. 0  vendor/rails/actionmailer/lib/action_mailer/vendor/text-format-0.6.3/text/format.rb
  235. +0 −4 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail.rb
  236. +0 −19 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/Makefile
  237. +0 −245 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/address.rb
  238. +0 −47 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/attachments.rb
  239. +0 −52 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/base64.rb
  240. +0 −39 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/compat.rb
  241. +0 −71 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/config.rb
  242. +0 −67 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/core_extensions.rb
  243. +0 −481 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/encode.rb
  244. +0 −552 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/facade.rb
  245. +0 −931 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/header.rb
  246. +0 −35 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/info.rb
  247. +0 −540 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/interface.rb
  248. +0 −1  vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/loader.rb
  249. +0 −462 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/mail.rb
  250. +0 −435 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/mailbox.rb
  251. +0 −1  vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/mbox.rb
  252. +0 −282 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/net.rb
  253. +0 −137 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/obsolete.rb
  254. +0 −1,475 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/parser.rb
  255. +0 −381 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/parser.y
  256. +0 −142 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/quoting.rb
  257. +0 −43 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/scanner.rb
  258. +0 −263 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/scanner_r.rb
  259. +0 −279 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/stringio.rb
  260. +0 −1  vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/tmail.rb
  261. +0 −281 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/utils.rb
  262. +0 −38 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/version.rb
  263. +5 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail.rb
  264. +426 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/address.rb
  265. +46 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/attachments.rb
  266. +46 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/base64.rb
  267. +41 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/compat.rb
  268. +67 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/config.rb
  269. +63 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/core_extensions.rb
  270. +581 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/encode.rb
  271. +960 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/header.rb
  272. +9 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/index.rb
  273. +1,130 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/interface.rb
  274. +3 −0  vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/loader.rb
  275. +578 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/mail.rb
  276. +495 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/mailbox.rb
  277. +6 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/main.rb
  278. +3 −0  vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/mbox.rb
  279. +248 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/net.rb
  280. +132 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/obsolete.rb
  281. +1,476 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/parser.rb
  282. 0  vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail-1.1.0 → tmail-1.2.3}/tmail/port.rb
  283. +118 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/quoting.rb
  284. +58 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/require_arch.rb
  285. +49 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/scanner.rb
  286. +261 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/scanner_r.rb
  287. +280 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/stringio.rb
  288. +337 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/utils.rb
  289. +39 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/version.rb
  290. +2 −2 vendor/rails/actionmailer/lib/action_mailer/version.rb
  291. +1 −1  vendor/rails/actionmailer/test/delivery_method_test.rb
  292. 0  vendor/rails/actionmailer/test/fixtures/first_mailer/share.rhtml
  293. 0  vendor/rails/actionmailer/test/fixtures/helper_mailer/use_example_helper.rhtml
  294. 0  vendor/rails/actionmailer/test/fixtures/helper_mailer/use_helper.rhtml
  295. 0  vendor/rails/actionmailer/test/fixtures/helper_mailer/use_helper_method.rhtml
  296. 0  vendor/rails/actionmailer/test/fixtures/helper_mailer/use_mail_helper.rhtml
  297. 0  ...ls/actionmailer/test/fixtures/path.with.dots/funky_path_mailer/multipart_with_template_path_with_dots.rhtml
  298. 0  vendor/rails/actionmailer/test/fixtures/path.with.dots/multipart_with_template_path_with_dots.rhtml
  299. BIN  vendor/rails/actionmailer/test/fixtures/raw_base64_decoded_string
  300. +0 −1  vendor/rails/actionmailer/test/fixtures/raw_base64_encoded_string
Sorry, we could not display the entire diff because too many files (1,360) changed.
View
132 lib/tasks/rspec.rake
@@ -0,0 +1,132 @@
+raise "To avoid rake task loading problems: run 'rake clobber' in vendor/plugins/rspec" if File.directory?(File.join(File.dirname(__FILE__), *%w[.. .. vendor plugins rspec pkg]))
+raise "To avoid rake task loading problems: run 'rake clobber' in vendor/plugins/rspec-rails" if File.directory?(File.join(File.dirname(__FILE__), *%w[.. .. vendor plugins rspec-rails pkg]))
+
+# In rails 1.2, plugins aren't available in the path until they're loaded.
+# Check to see if the rspec plugin is installed first and require
+# it if it is. If not, use the gem version.
+rspec_base = File.expand_path(File.dirname(__FILE__) + '/../../vendor/plugins/rspec/lib')
+$LOAD_PATH.unshift(rspec_base) if File.exist?(rspec_base)
+require 'spec/rake/spectask'
+
+spec_prereq = File.exist?(File.join(RAILS_ROOT, 'config', 'database.yml')) ? "db:test:prepare" : :noop
+task :noop do
+end
+
+task :default => :spec
+task :stats => "spec:statsetup"
+
+desc "Run all specs in spec directory (excluding plugin specs)"
+Spec::Rake::SpecTask.new(:spec => spec_prereq) do |t|
+ t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]
+ t.spec_files = FileList['spec/**/*_spec.rb']
+end
+
+namespace :spec do
+ desc "Run all specs in spec directory with RCov (excluding plugin specs)"
+ Spec::Rake::SpecTask.new(:rcov) do |t|
+ t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]
+ t.spec_files = FileList['spec/**/*_spec.rb']
+ t.rcov = true
+ t.rcov_opts = lambda do
+ IO.readlines("#{RAILS_ROOT}/spec/rcov.opts").map {|l| l.chomp.split " "}.flatten
+ end
+ end
+
+ desc "Print Specdoc for all specs (excluding plugin specs)"
+ Spec::Rake::SpecTask.new(:doc) do |t|
+ t.spec_opts = ["--format", "specdoc", "--dry-run"]
+ t.spec_files = FileList['spec/**/*_spec.rb']
+ end
+
+ desc "Print Specdoc for all plugin specs"
+ Spec::Rake::SpecTask.new(:plugin_doc) do |t|
+ t.spec_opts = ["--format", "specdoc", "--dry-run"]
+ t.spec_files = FileList['vendor/plugins/**/spec/**/*_spec.rb'].exclude('vendor/plugins/rspec/*')
+ end
+
+ [:models, :controllers, :views, :helpers, :lib].each do |sub|
+ desc "Run the specs under spec/#{sub}"
+ Spec::Rake::SpecTask.new(sub => spec_prereq) do |t|
+ t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]
+ t.spec_files = FileList["spec/#{sub}/**/*_spec.rb"]
+ end
+ end
+
+ desc "Run the specs under vendor/plugins (except RSpec's own)"
+ Spec::Rake::SpecTask.new(:plugins => spec_prereq) do |t|
+ t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]
+ t.spec_files = FileList['vendor/plugins/**/spec/**/*_spec.rb'].exclude('vendor/plugins/rspec/*').exclude("vendor/plugins/rspec-rails/*")
+ end
+
+ namespace :plugins do
+ desc "Runs the examples for rspec_on_rails"
+ Spec::Rake::SpecTask.new(:rspec_on_rails) do |t|
+ t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]
+ t.spec_files = FileList['vendor/plugins/rspec-rails/spec/**/*_spec.rb']
+ end
+ end
+
+ # Setup specs for stats
+ task :statsetup do
+ require 'code_statistics'
+ ::STATS_DIRECTORIES << %w(Model\ specs spec/models) if File.exist?('spec/models')
+ ::STATS_DIRECTORIES << %w(View\ specs spec/views) if File.exist?('spec/views')
+ ::STATS_DIRECTORIES << %w(Controller\ specs spec/controllers) if File.exist?('spec/controllers')
+ ::STATS_DIRECTORIES << %w(Helper\ specs spec/helpers) if File.exist?('spec/helpers')
+ ::STATS_DIRECTORIES << %w(Library\ specs spec/lib) if File.exist?('spec/lib')
+ ::CodeStatistics::TEST_TYPES << "Model specs" if File.exist?('spec/models')
+ ::CodeStatistics::TEST_TYPES << "View specs" if File.exist?('spec/views')
+ ::CodeStatistics::TEST_TYPES << "Controller specs" if File.exist?('spec/controllers')
+ ::CodeStatistics::TEST_TYPES << "Helper specs" if File.exist?('spec/helpers')
+ ::CodeStatistics::TEST_TYPES << "Library specs" if File.exist?('spec/lib')
+ ::STATS_DIRECTORIES.delete_if {|a| a[0] =~ /test/}
+ end
+
+ namespace :db do
+ namespace :fixtures do
+ desc "Load fixtures (from spec/fixtures) into the current environment's database. Load specific fixtures using FIXTURES=x,y"
+ task :load => :environment do
+ require 'active_record/fixtures'
+ ActiveRecord::Base.establish_connection(RAILS_ENV.to_sym)
+ (ENV['FIXTURES'] ? ENV['FIXTURES'].split(/,/) : Dir.glob(File.join(RAILS_ROOT, 'spec', 'fixtures', '*.{yml,csv}'))).each do |fixture_file|
+ Fixtures.create_fixtures('spec/fixtures', File.basename(fixture_file, '.*'))
+ end
+ end
+ end
+ end
+
+ namespace :server do
+ daemonized_server_pid = File.expand_path("spec_server.pid", RAILS_ROOT + "/tmp")
+
+ desc "start spec_server."
+ task :start do
+ if File.exist?(daemonized_server_pid)
+ $stderr.puts "spec_server is already running."
+ else
+ $stderr.puts "Starting up spec server."
+ system("ruby", "script/spec_server", "--daemon", "--pid", daemonized_server_pid)
+ end
+ end
+
+ desc "stop spec_server."
+ task :stop do
+ unless File.exist?(daemonized_server_pid)
+ $stderr.puts "No server running."
+ else
+ $stderr.puts "Shutting down spec_server."
+ system("kill", "-s", "TERM", File.read(daemonized_server_pid).strip) &&
+ File.delete(daemonized_server_pid)
+ end
+ end
+
+ desc "reload spec_server."
+ task :restart do
+ unless File.exist?(daemonized_server_pid)
+ $stderr.puts "No server running."
+ else
+ $stderr.puts "Reloading down spec_server."
+ system("kill", "-s", "USR2", File.read(daemonized_server_pid).strip)
+ end
+ end
+ end
+end
View
3  script/autospec
@@ -0,0 +1,3 @@
+#!/usr/bin/env ruby
+ENV['RSPEC'] = 'true'
+system 'autotest'
View
22 script/spec_server
@@ -1,5 +1,4 @@
#!/usr/bin/env ruby
-$LOAD_PATH.unshift File.dirname(__FILE__) + '/../../rspec/lib' # For svn
$LOAD_PATH.unshift File.dirname(__FILE__) + '/../vendor/plugins/rspec/lib' # For rspec installed as plugin
require 'rubygems'
require 'drb/drb'
@@ -23,20 +22,29 @@ module Spec
active_connections.delete(name)
end
end
- end
+ end
if ActionController.const_defined?(:Dispatcher)
dispatcher = ::ActionController::Dispatcher.new($stdout)
- dispatcher.cleanup_application(true)
+ dispatcher.cleanup_application
elsif ::Dispatcher.respond_to?(:reset_application!)
::Dispatcher.reset_application!
else
raise "Application reloading failed"
end
+ if Object.const_defined?(:Fixtures) && Fixtures.respond_to?(:reset_cache)
+ Fixtures.reset_cache
+ end
+
::Dependencies.mechanism = :load
require_dependency('application.rb') unless Object.const_defined?(:ApplicationController)
load File.dirname(__FILE__) + '/../spec/spec_helper.rb'
+ if in_memory_database?
+ load "#{RAILS_ROOT}/db/schema.rb" # use db agnostic schema by default
+ ActiveRecord::Migrator.up('db/migrate') # use migrations
+ end
+
::Spec::Runner::CommandLine.run(
::Spec::Runner::OptionParser.parse(
argv,
@@ -45,6 +53,12 @@ module Spec
)
)
end
+
+ def in_memory_database?
+ ENV["RAILS_ENV"] == "test" and
+ ::ActiveRecord::Base.connection.class.to_s == "ActiveRecord::ConnectionAdapters::SQLite3Adapter" and
+ ::Rails::Configuration.new.database_configuration['test']['database'] == ':memory:'
+ end
end
end
end
@@ -91,7 +105,7 @@ opts.parse!(ARGV)
puts "Ready"
exec_server = lambda {
trap("USR2") { restart_test_server } if Signal.list.has_key?("USR2")
- DRb.start_service("druby://localhost:8989", Spec::Runner::RailsSpecServer.new)
+ DRb.start_service("druby://127.0.0.1:8989", Spec::Runner::RailsSpecServer.new)
DRb.thread.join
}
View
7 spec/spec.opts
@@ -1,7 +1,4 @@
--colour
---format
-progress
---loadby
-mtime
+--format progress
+--loadby mtime
--reverse
---backtrace
View
9 spec/spec_helper.rb
@@ -4,6 +4,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
require 'spec'
require 'spec/rails'
+
require File.expand_path(File.dirname(__FILE__) + "/be_valid_xhtml")
Spec::Runner.configure do |config|
@@ -29,6 +30,10 @@
# If you declare global fixtures, be aware that they will be declared
# for all of your examples, even those that don't use them.
#
+ # You can also declare which fixtures to use (for example fixtures for test/fixtures):
+ #
+ # config.fixture_path = RAILS_ROOT + '/spec/fixtures/'
+ #
# == Mock Framework
#
# RSpec uses it's own mocking framework by default. If you prefer to
@@ -37,6 +42,10 @@
# config.mock_with :mocha
# config.mock_with :flexmock
# config.mock_with :rr
+ #
+ # == Notes
+ #
+ # For more information take a look at Spec::Example::Configuration and Spec::Runner
end
describe "ATOM feed", :shared => true do
View
7 vendor/plugins/rspec-rails/.gitignore
@@ -0,0 +1,7 @@
+tmtags
+.DS_Store
+.emacs-project
+*~
+pkg
+doc
+email.txt
View
44 vendor/plugins/rspec-rails/History.txt
@@ -0,0 +1,44 @@
+=== In Development (git clone git://github.com/dchelimsky/rspec-rails.git)
+
+IMPORTANT: use 'script/autospec' (or just 'autospec' if you have the rspec gem
+installed) instead of 'autotest'. We changed the way autotest discovers rspec
+so the autotest executable won't automatically load rspec anymore. This allows
+rspec to live side by side other spec frameworks without always co-opting
+autotest through autotest's discovery mechanism.
+
+ALSO IMPORTANT: Rails v2.1.1 changed assert_select_rjs such that it doesn't
+always fail when it should. Please see
+http://rails.lighthouseapp.com/projects/8994/tickets/982.
+
+* Generated route specs have shorter names, making it less painful to modify their implementation
+* Add conditional so Rails 2.1.0 doesn't warn about cache_template_extensions (patch from James Herdman)
+* Fixed stub_model examples to work with Rails 2.1.0 (the code was fine, just the examples needed patching)
+* use hoe for build/release
+* reworked generated examples for rspec_scaffold - thanks to Mikel Lindsaar and Dan Manges for their feedback
+* bye, bye translator
+* Added proxy to cookies so you can set them in examples the same way you set them in controllers
+* Added script/autospec so you can run autospec without installing the gem
+* Support --skip-fixture in the rspec_model generator (patches from Alex Tomlins and Niels Ganser)
+* Add mock_model#as_new_record (patch from Zach Dennis)
+
+=== Version 1.1.4
+
+Maintenance release.
+
+* Moved mock_model and stub_model to their own module: Spec::Rails::Mocks
+* Setting mock_model object id with stubs hash - patch from Adam Meehan
+* Added as_new_record to stub_model e.g. stub_model(Foo).as_new_record
+* Improved stub_model such that new_record? does "the right thing"
+* Patch from Pat Maddox to get integrate_views to work in nested example groups.
+* Patch from Pat Maddox to get controller_name to work in nested example groups.
+* Patch from Corey Haines to add include_text matcher
+* Added stub_model method which creates a real model instance with :id stubbed and data access prohibited.
+* Applied patch from Pat Maddox to handle redirect_to w/ SSL. Closes #320.
+* Added #helper and #assigns to helper specs.
+* Applied patch from Bryan Helmkamp to tweak format of generated spec.opts to be more obvious. Closes #162.
+* Tweaked list of exceptions (ignores) for autotest
+* Applied patch from Rick Olson to get rspec_on_rails working with rails edge (>= 8862)
+* Applied patch from Wincent Colaiuta to invert sense of "spec --diff". Closes #281.
+* Allow any type of render in view specs. Closes #57.
+* Applied patch from Ian White to get rspec working with edge rails (8804). Closes #271.
+* Applied patch from Jon Strother to have spec_server reload fixtures. Closes #344.
View
151 vendor/plugins/rspec-rails/Manifest.txt
@@ -0,0 +1,151 @@
+.gitignore
+History.txt
+Manifest.txt
+README.txt
+Rakefile
+UPGRADE
+generators/rspec/CHANGES
+generators/rspec/rspec_generator.rb
+generators/rspec/templates/all_stories.rb
+generators/rspec/templates/previous_failures.txt
+generators/rspec/templates/rcov.opts
+generators/rspec/templates/rspec.rake
+generators/rspec/templates/script/autospec
+generators/rspec/templates/script/spec
+generators/rspec/templates/script/spec_server
+generators/rspec/templates/spec.opts
+generators/rspec/templates/spec_helper.rb
+generators/rspec/templates/stories_helper.rb
+generators/rspec_controller/USAGE
+generators/rspec_controller/rspec_controller_generator.rb
+generators/rspec_controller/templates/controller_spec.rb
+generators/rspec_controller/templates/helper_spec.rb
+generators/rspec_controller/templates/view_spec.rb
+generators/rspec_default_values.rb
+generators/rspec_model/USAGE
+generators/rspec_model/rspec_model_generator.rb
+generators/rspec_model/templates/model_spec.rb
+generators/rspec_scaffold/rspec_scaffold_generator.rb
+generators/rspec_scaffold/templates/controller_spec.rb
+generators/rspec_scaffold/templates/edit_erb_spec.rb
+generators/rspec_scaffold/templates/helper_spec.rb
+generators/rspec_scaffold/templates/index_erb_spec.rb
+generators/rspec_scaffold/templates/new_erb_spec.rb
+generators/rspec_scaffold/templates/routing_spec.rb
+generators/rspec_scaffold/templates/show_erb_spec.rb
+init.rb
+lib/autotest/discover.rb
+lib/autotest/rails_rspec.rb
+lib/spec/rails.rb
+lib/spec/rails/example.rb
+lib/spec/rails/example/assigns_hash_proxy.rb
+lib/spec/rails/example/controller_example_group.rb
+lib/spec/rails/example/functional_example_group.rb
+lib/spec/rails/example/cookies_proxy.rb
+lib/spec/rails/example/helper_example_group.rb
+lib/spec/rails/example/model_example_group.rb
+lib/spec/rails/example/rails_example_group.rb
+lib/spec/rails/example/render_observer.rb
+lib/spec/rails/example/view_example_group.rb
+lib/spec/rails/extensions.rb
+lib/spec/rails/extensions/action_controller/base.rb
+lib/spec/rails/extensions/action_controller/rescue.rb
+lib/spec/rails/extensions/action_controller/test_response.rb
+lib/spec/rails/extensions/action_view/base.rb
+lib/spec/rails/extensions/active_record/base.rb
+lib/spec/rails/extensions/object.rb
+lib/spec/rails/extensions/spec/example/configuration.rb
+lib/spec/rails/extensions/spec/matchers/have.rb
+lib/spec/rails/interop/testcase.rb
+lib/spec/rails/matchers.rb
+lib/spec/rails/matchers/assert_select.rb
+lib/spec/rails/matchers/have_text.rb
+lib/spec/rails/matchers/include_text.rb
+lib/spec/rails/matchers/redirect_to.rb
+lib/spec/rails/matchers/render_template.rb
+lib/spec/rails/mocks.rb
+lib/spec/rails/story_adapter.rb
+lib/spec/rails/version.rb
+spec/rails/autotest/mappings_spec.rb
+spec/rails/example/assigns_hash_proxy_spec.rb
+spec/rails/example/configuration_spec.rb
+spec/rails/example/controller_isolation_spec.rb
+spec/rails/example/controller_spec_spec.rb
+spec/rails/example/cookies_proxy_spec.rb
+spec/rails/example/example_group_factory_spec.rb
+spec/rails/example/helper_spec_spec.rb
+spec/rails/example/model_spec_spec.rb
+spec/rails/example/shared_behaviour_spec.rb
+spec/rails/example/test_unit_assertion_accessibility_spec.rb
+spec/rails/example/view_spec_spec.rb
+spec/rails/extensions/action_controller_rescue_action_spec.rb
+spec/rails/extensions/action_view_base_spec.rb
+spec/rails/extensions/active_record_spec.rb
+spec/rails/matchers/assert_select_spec.rb
+spec/rails/interop/testcase_spec.rb
+spec/rails/matchers/description_generation_spec.rb
+spec/rails/matchers/errors_on_spec.rb
+spec/rails/matchers/have_text_spec.rb
+spec/rails/matchers/include_text_spec.rb
+spec/rails/matchers/redirect_to_spec.rb
+spec/rails/matchers/render_spec.rb
+spec/rails/mocks/ar_classes.rb
+spec/rails/mocks/mock_model_spec.rb
+spec/rails/mocks/stub_model_spec.rb
+spec/rails/sample_modified_fixture.rb
+spec/rails/sample_spec.rb
+spec/rails/spec_server_spec.rb
+spec/rails/spec_spec.rb
+spec/rails_suite.rb
+spec/spec_helper.rb
+spec_resources/controllers/action_view_base_spec_controller.rb
+spec_resources/controllers/controller_spec_controller.rb
+spec_resources/controllers/redirect_spec_controller.rb
+spec_resources/controllers/render_spec_controller.rb
+spec_resources/controllers/rjs_spec_controller.rb
+spec_resources/helpers/explicit_helper.rb
+spec_resources/helpers/more_explicit_helper.rb
+spec_resources/helpers/plugin_application_helper.rb
+spec_resources/helpers/view_spec_helper.rb
+spec_resources/views/controller_spec/_partial.rhtml
+spec_resources/views/controller_spec/action_setting_flash_after_session_reset.rhtml
+spec_resources/views/controller_spec/action_setting_flash_before_session_reset.rhtml
+spec_resources/views/controller_spec/action_setting_the_assigns_hash.rhtml
+spec_resources/views/controller_spec/action_with_errors_in_template.rhtml
+spec_resources/views/controller_spec/action_with_template.rhtml
+spec_resources/views/render_spec/_a_partial.rhtml
+spec_resources/views/render_spec/some_action.js.rjs
+spec_resources/views/render_spec/some_action.rhtml
+spec_resources/views/render_spec/some_action.rjs
+spec_resources/views/rjs_spec/_replacement_partial.rhtml
+spec_resources/views/rjs_spec/hide_div.rjs
+spec_resources/views/rjs_spec/hide_page_element.rjs
+spec_resources/views/rjs_spec/insert_html.rjs
+spec_resources/views/rjs_spec/replace.rjs
+spec_resources/views/rjs_spec/replace_html.rjs
+spec_resources/views/rjs_spec/replace_html_with_partial.rjs
+spec_resources/views/rjs_spec/visual_effect.rjs
+spec_resources/views/rjs_spec/visual_toggle_effect.rjs
+spec_resources/views/tag_spec/no_tags.rhtml
+spec_resources/views/tag_spec/single_div_with_no_attributes.rhtml
+spec_resources/views/tag_spec/single_div_with_one_attribute.rhtml
+spec_resources/views/view_spec/_partial.rhtml
+spec_resources/views/view_spec/_partial_used_twice.rhtml
+spec_resources/views/view_spec/_partial_with_local_variable.rhtml
+spec_resources/views/view_spec/_partial_with_sub_partial.rhtml
+spec_resources/views/view_spec/_spacer.rhtml
+spec_resources/views/view_spec/accessor.rhtml
+spec_resources/views/view_spec/entry_form.rhtml
+spec_resources/views/view_spec/explicit_helper.rhtml
+spec_resources/views/view_spec/foo/show.rhtml
+spec_resources/views/view_spec/implicit_helper.rhtml
+spec_resources/views/view_spec/multiple_helpers.rhtml
+spec_resources/views/view_spec/template_with_partial.rhtml
+spec_resources/views/view_spec/template_with_partial_using_collection.rhtml
+spec_resources/views/view_spec/template_with_partial_with_array.rhtml
+stories/all.rb
+stories/configuration/stories.rb
+stories/helper.rb
+stories/steps/people.rb
+stories/transactions_should_rollback
+stories/transactions_should_rollback.rb
View
81 vendor/plugins/rspec-rails/README.txt
@@ -0,0 +1,81 @@
+= Spec::Rails
+
+* http://rspec.info
+* http://rspec.info/rdoc-rails/
+* http://github.com/dchelimsky/rspec-rails/wikis
+* mailto:rspec-devel@rubyforge.org
+
+== DESCRIPTION:
+
+Behaviour Driven Development for Ruby on Rails.
+
+Spec::Rails (a.k.a. RSpec on Rails) is a Ruby on Rails plugin that allows you
+to drive the development of your RoR application using RSpec, a framework that
+aims to enable Example Driven Development in Ruby.
+
+== FEATURES:
+
+* Use RSpec to independently specify Rails Models, Views, Controllers and Helpers
+* Integrated fixture loading
+* Special generators for Resources, Models, Views and Controllers that generate Specs instead of Tests.
+
+== VISION:
+
+For people for whom TDD is a brand new concept, the testing support built into
+Ruby on Rails is a huge leap forward. The fact that it is built right in is
+fantastic, and Ruby on Rails apps are generally much easier to maintain than
+they might have been without such support.
+
+For those of us coming from a history with TDD, and now BDD, the existing
+support presents some problems related to dependencies across examples. To
+that end, RSpec on Rails supports 4 types of examples. We’ve also built in
+first class mocking and stubbing support in order to break dependencies across
+these different concerns.
+
+== MORE INFORMATION:
+
+See Spec::Rails::Runner for information about the different kinds of example
+groups you can use to spec the different Rails components
+
+See Spec::Rails::Expectations for information about Rails-specific
+expectations you can set on responses and models, etc.
+
+== INSTALL
+
+* Visit http://github.com/dchelimsky/rspec-rails/wikis for installation instructions.
+
+== LICENSE
+
+(The MIT License)
+
+====================================================================
+==== RSpec, RSpec-Rails
+Copyright (c) 2005-2008 The RSpec Development Team
+====================================================================
+==== ARTS
+Copyright (c) 2006 Kevin Clark, Jake Howerton
+====================================================================
+==== ZenTest
+Copyright (c) 2001-2006 Ryan Davis, Eric Hodel, Zen Spider Software
+====================================================================
+==== AssertSelect
+Copyright (c) 2006 Assaf Arkin
+====================================================================
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
View
37 vendor/plugins/rspec-rails/Rakefile
@@ -0,0 +1,37 @@
+require 'rubygems'
+require 'hoe'
+require './lib/spec/rails/version'
+
+class Hoe
+ def extra_deps
+ @extra_deps.reject! { |x| Array(x).first == 'hoe' }
+ @extra_deps
+ end
+end
+
+Hoe.new('rspec-rails', Spec::Rails::VERSION::STRING) do |p|
+ p.summary = Spec::Rails::VERSION::SUMMARY
+ p.url = 'http://rspec.info/'
+ p.description = "Behaviour Driven Development for Ruby on Rails."
+ p.rubyforge_name = 'rspec'
+ p.developer('RSpec Development Team', 'rspec-devel@rubyforge.org')
+end
+
+['audit','test','test_deps','default','publish_docs','post_blog', 'release'].each do |task|
+ Rake.application.instance_variable_get('@tasks').delete(task)
+end
+
+task :release => [:clean, :package] do |t|
+ version = ENV["VERSION"] or abort "Must supply VERSION=x.y.z"
+ abort "Versions don't match #{version} vs #{Spec::Rails::VERSION::STRING}" unless version == Spec::Rails::VERSION::STRING
+ pkg = "pkg/rspec-rails-#{version}"
+
+ rubyforge = RubyForge.new.configure
+ puts "Logging in to rubyforge ..."
+ rubyforge.login
+
+ puts "Releasing rspec-rails version #{version} ..."
+ ["#{pkg}.gem", "#{pkg}.tgz"].each do |file|
+ rubyforge.add_file('rspec', 'rspec', Spec::Rails::VERSION::STRING, file)
+ end
+end
View
7 vendor/plugins/rspec-rails/UPGRADE
@@ -0,0 +1,7 @@
+== Upgrade
+
+ script/generate rspec
+
+Or modify spec_helper.rb based on the template, which can be found at:
+
+ vendor/plugins/rspec-rails/generators/rspec/templates/spec_helper.rb
View
0  ...r/plugins/rspec_on_rails/generators/rspec/CHANGES → vendor/plugins/rspec-rails/generators/rspec/CHANGES
File renamed without changes
View
40 vendor/plugins/rspec-rails/generators/rspec/rspec_generator.rb
@@ -0,0 +1,40 @@
+require 'rbconfig'
+
+# This generator bootstraps a Rails project for use with RSpec
+class RspecGenerator < Rails::Generator::Base
+ DEFAULT_SHEBANG = File.join(Config::CONFIG['bindir'],
+ Config::CONFIG['ruby_install_name'])
+
+ def initialize(runtime_args, runtime_options = {})
+ Dir.mkdir('lib/tasks') unless File.directory?('lib/tasks')
+ super
+ end
+
+ def manifest
+ record do |m|
+ script_options = { :chmod => 0755, :shebang => options[:shebang] == DEFAULT_SHEBANG ? nil : options[:shebang] }
+
+ m.file 'rspec.rake', 'lib/tasks/rspec.rake'
+
+ m.file 'script/autospec', 'script/autospec', script_options
+ m.file 'script/spec', 'script/spec', script_options
+ m.file 'script/spec_server', 'script/spec_server', script_options
+
+ m.directory 'spec'
+ m.file 'rcov.opts', 'spec/rcov.opts'
+ m.file 'spec.opts', 'spec/spec.opts'
+ m.template 'spec_helper.rb', 'spec/spec_helper.rb'
+
+ m.directory 'stories'
+ m.file 'all_stories.rb', 'stories/all.rb'
+ m.file 'stories_helper.rb', 'stories/helper.rb'
+ end
+ end
+
+protected
+
+ def banner
+ "Usage: #{$0} rspec"
+ end
+
+end
View
0  ...n_rails/generators/rspec/templates/all_stories.rb → ...c-rails/generators/rspec/templates/all_stories.rb
File renamed without changes
View
0  .../generators/rspec/templates/previous_failures.txt → .../generators/rspec/templates/previous_failures.txt
File renamed without changes
View
0  ...pec_on_rails/generators/rspec/templates/rcov.opts → .../rspec-rails/generators/rspec/templates/rcov.opts
File renamed without changes
View
132 vendor/plugins/rspec-rails/generators/rspec/templates/rspec.rake
@@ -0,0 +1,132 @@
+raise "To avoid rake task loading problems: run 'rake clobber' in vendor/plugins/rspec" if File.directory?(File.join(File.dirname(__FILE__), *%w[.. .. vendor plugins rspec pkg]))
+raise "To avoid rake task loading problems: run 'rake clobber' in vendor/plugins/rspec-rails" if File.directory?(File.join(File.dirname(__FILE__), *%w[.. .. vendor plugins rspec-rails pkg]))
+
+# In rails 1.2, plugins aren't available in the path until they're loaded.
+# Check to see if the rspec plugin is installed first and require
+# it if it is. If not, use the gem version.
+rspec_base = File.expand_path(File.dirname(__FILE__) + '/../../vendor/plugins/rspec/lib')
+$LOAD_PATH.unshift(rspec_base) if File.exist?(rspec_base)
+require 'spec/rake/spectask'
+
+spec_prereq = File.exist?(File.join(RAILS_ROOT, 'config', 'database.yml')) ? "db:test:prepare" : :noop
+task :noop do
+end
+
+task :default => :spec
+task :stats => "spec:statsetup"
+
+desc "Run all specs in spec directory (excluding plugin specs)"
+Spec::Rake::SpecTask.new(:spec => spec_prereq) do |t|
+ t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]
+ t.spec_files = FileList['spec/**/*_spec.rb']
+end
+
+namespace :spec do
+ desc "Run all specs in spec directory with RCov (excluding plugin specs)"
+ Spec::Rake::SpecTask.new(:rcov) do |t|
+ t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]
+ t.spec_files = FileList['spec/**/*_spec.rb']
+ t.rcov = true
+ t.rcov_opts = lambda do
+ IO.readlines("#{RAILS_ROOT}/spec/rcov.opts").map {|l| l.chomp.split " "}.flatten
+ end
+ end
+
+ desc "Print Specdoc for all specs (excluding plugin specs)"
+ Spec::Rake::SpecTask.new(:doc) do |t|
+ t.spec_opts = ["--format", "specdoc", "--dry-run"]
+ t.spec_files = FileList['spec/**/*_spec.rb']
+ end
+
+ desc "Print Specdoc for all plugin specs"
+ Spec::Rake::SpecTask.new(:plugin_doc) do |t|
+ t.spec_opts = ["--format", "specdoc", "--dry-run"]
+ t.spec_files = FileList['vendor/plugins/**/spec/**/*_spec.rb'].exclude('vendor/plugins/rspec/*')
+ end
+
+ [:models, :controllers, :views, :helpers, :lib].each do |sub|
+ desc "Run the specs under spec/#{sub}"
+ Spec::Rake::SpecTask.new(sub => spec_prereq) do |t|
+ t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]
+ t.spec_files = FileList["spec/#{sub}/**/*_spec.rb"]
+ end
+ end
+
+ desc "Run the specs under vendor/plugins (except RSpec's own)"
+ Spec::Rake::SpecTask.new(:plugins => spec_prereq) do |t|
+ t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]
+ t.spec_files = FileList['vendor/plugins/**/spec/**/*_spec.rb'].exclude('vendor/plugins/rspec/*').exclude("vendor/plugins/rspec-rails/*")
+ end
+
+ namespace :plugins do
+ desc "Runs the examples for rspec_on_rails"
+ Spec::Rake::SpecTask.new(:rspec_on_rails) do |t|
+ t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]
+ t.spec_files = FileList['vendor/plugins/rspec-rails/spec/**/*_spec.rb']
+ end
+ end
+
+ # Setup specs for stats
+ task :statsetup do
+ require 'code_statistics'
+ ::STATS_DIRECTORIES << %w(Model\ specs spec/models) if File.exist?('spec/models')
+ ::STATS_DIRECTORIES << %w(View\ specs spec/views) if File.exist?('spec/views')
+ ::STATS_DIRECTORIES << %w(Controller\ specs spec/controllers) if File.exist?('spec/controllers')
+ ::STATS_DIRECTORIES << %w(Helper\ specs spec/helpers) if File.exist?('spec/helpers')
+ ::STATS_DIRECTORIES << %w(Library\ specs spec/lib) if File.exist?('spec/lib')
+ ::CodeStatistics::TEST_TYPES << "Model specs" if File.exist?('spec/models')
+ ::CodeStatistics::TEST_TYPES << "View specs" if File.exist?('spec/views')
+ ::CodeStatistics::TEST_TYPES << "Controller specs" if File.exist?('spec/controllers')
+ ::CodeStatistics::TEST_TYPES << "Helper specs" if File.exist?('spec/helpers')
+ ::CodeStatistics::TEST_TYPES << "Library specs" if File.exist?('spec/lib')
+ ::STATS_DIRECTORIES.delete_if {|a| a[0] =~ /test/}
+ end
+
+ namespace :db do
+ namespace :fixtures do
+ desc "Load fixtures (from spec/fixtures) into the current environment's database. Load specific fixtures using FIXTURES=x,y"
+ task :load => :environment do
+ require 'active_record/fixtures'
+ ActiveRecord::Base.establish_connection(RAILS_ENV.to_sym)
+ (ENV['FIXTURES'] ? ENV['FIXTURES'].split(/,/) : Dir.glob(File.join(RAILS_ROOT, 'spec', 'fixtures', '*.{yml,csv}'))).each do |fixture_file|
+ Fixtures.create_fixtures('spec/fixtures', File.basename(fixture_file, '.*'))
+ end
+ end
+ end
+ end
+
+ namespace :server do
+ daemonized_server_pid = File.expand_path("spec_server.pid", RAILS_ROOT + "/tmp")
+
+ desc "start spec_server."
+ task :start do
+ if File.exist?(daemonized_server_pid)
+ $stderr.puts "spec_server is already running."
+ else
+ $stderr.puts "Starting up spec server."
+ system("ruby", "script/spec_server", "--daemon", "--pid", daemonized_server_pid)
+ end
+ end
+
+ desc "stop spec_server."
+ task :stop do
+ unless File.exist?(daemonized_server_pid)
+ $stderr.puts "No server running."
+ else
+ $stderr.puts "Shutting down spec_server."
+ system("kill", "-s", "TERM", File.read(daemonized_server_pid).strip) &&
+ File.delete(daemonized_server_pid)
+ end
+ end
+
+ desc "reload spec_server."
+ task :restart do
+ unless File.exist?(daemonized_server_pid)
+ $stderr.puts "No server running."
+ else
+ $stderr.puts "Reloading down spec_server."
+ system("kill", "-s", "USR2", File.read(daemonized_server_pid).strip)
+ end
+ end
+ end
+end
View
3  vendor/plugins/rspec-rails/generators/rspec/templates/script/autospec
@@ -0,0 +1,3 @@
+#!/usr/bin/env ruby
+ENV['RSPEC'] = 'true'
+system 'autotest'
View
0  ...c_on_rails/generators/rspec/templates/script/spec → ...spec-rails/generators/rspec/templates/script/spec
File renamed without changes
View
116 vendor/plugins/rspec-rails/generators/rspec/templates/script/spec_server
@@ -0,0 +1,116 @@
+#!/usr/bin/env ruby
+$LOAD_PATH.unshift File.dirname(__FILE__) + '/../vendor/plugins/rspec/lib' # For rspec installed as plugin
+require 'rubygems'
+require 'drb/drb'
+require 'rbconfig'
+require 'spec'
+require 'optparse'
+
+# This is based on Florian Weber's TDDMate
+module Spec
+ module Runner
+ class RailsSpecServer
+ def run(argv, stderr, stdout)
+ $stdout = stdout
+ $stderr = stderr
+
+ base = ActiveRecord::Base
+ def base.clear_reloadable_connections!
+ active_connections.each do |name, conn|
+ if conn.requires_reloading?
+ conn.disconnect!
+ active_connections.delete(name)
+ end
+ end
+ end
+
+ if ActionController.const_defined?(:Dispatcher)
+ dispatcher = ::ActionController::Dispatcher.new($stdout)
+ dispatcher.cleanup_application
+ elsif ::Dispatcher.respond_to?(:reset_application!)
+ ::Dispatcher.reset_application!
+ else
+ raise "Application reloading failed"
+ end
+ if Object.const_defined?(:Fixtures) && Fixtures.respond_to?(:reset_cache)
+ Fixtures.reset_cache
+ end
+
+ ::Dependencies.mechanism = :load
+ require_dependency('application.rb') unless Object.const_defined?(:ApplicationController)
+ load File.dirname(__FILE__) + '/../spec/spec_helper.rb'
+
+ if in_memory_database?
+ load "#{RAILS_ROOT}/db/schema.rb" # use db agnostic schema by default
+ ActiveRecord::Migrator.up('db/migrate') # use migrations
+ end
+
+ ::Spec::Runner::CommandLine.run(
+ ::Spec::Runner::OptionParser.parse(
+ argv,
+ $stderr,
+ $stdout
+ )
+ )
+ end
+
+ def in_memory_database?
+ ENV["RAILS_ENV"] == "test" and
+ ::ActiveRecord::Base.connection.class.to_s == "ActiveRecord::ConnectionAdapters::SQLite3Adapter" and
+ ::Rails::Configuration.new.database_configuration['test']['database'] == ':memory:'
+ end
+ end
+ end
+end
+puts "Loading Rails environment"
+
+ENV["RAILS_ENV"] = "test"
+require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
+require 'dispatcher'
+
+def restart_test_server
+ puts "restarting"
+ config = ::Config::CONFIG
+ ruby = File::join(config['bindir'], config['ruby_install_name']) + config['EXEEXT']
+ command_line = [ruby, $0, ARGV].flatten.join(' ')
+ exec(command_line)
+end
+
+def daemonize(pid_file = nil)
+ return yield if $DEBUG
+ pid = Process.fork{
+ Process.setsid
+ Dir.chdir(RAILS_ROOT)
+ trap("SIGINT"){ exit! 0 }
+ trap("SIGTERM"){ exit! 0 }
+ trap("SIGHUP"){ restart_test_server }
+ File.open("/dev/null"){|f|
+ STDERR.reopen f
+ STDIN.reopen f
+ STDOUT.reopen f
+ }
+ yield
+ }
+ puts "spec_server launched. (PID: %d)" % pid
+ File.open(pid_file,"w"){|f| f.puts pid } if pid_file
+ exit! 0
+end
+
+options = Hash.new
+opts = OptionParser.new
+opts.on("-d", "--daemon"){|v| options[:daemon] = true }
+opts.on("-p", "--pid PIDFILE"){|v| options[:pid] = v }
+opts.parse!(ARGV)
+
+puts "Ready"
+exec_server = lambda {
+ trap("USR2") { restart_test_server } if Signal.list.has_key?("USR2")
+ DRb.start_service("druby://127.0.0.1:8989", Spec::Runner::RailsSpecServer.new)
+ DRb.thread.join
+}
+
+if options[:daemon]
+ daemonize(options[:pid], &exec_server)
+else
+ exec_server.call
+end
View
4 vendor/plugins/rspec-rails/generators/rspec/templates/spec.opts
@@ -0,0 +1,4 @@
+--colour
+--format progress
+--loadby mtime
+--reverse
View
47 vendor/plugins/rspec-rails/generators/rspec/templates/spec_helper.rb
@@ -0,0 +1,47 @@
+# This file is copied to ~/spec when you run 'ruby script/generate rspec'
+# from the project root directory.
+ENV["RAILS_ENV"] = "test"
+require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
+require 'spec'
+require 'spec/rails'
+
+Spec::Runner.configure do |config|
+ # If you're not using ActiveRecord you should remove these
+ # lines, delete config/database.yml and disable :active_record
+ # in your config/boot.rb
+ config.use_transactional_fixtures = true
+ config.use_instantiated_fixtures = false
+ config.fixture_path = RAILS_ROOT + '/spec/fixtures/'
+
+ # == Fixtures
+ #
+ # You can declare fixtures for each example_group like this:
+ # describe "...." do
+ # fixtures :table_a, :table_b
+ #
+ # Alternatively, if you prefer to declare them only once, you can
+ # do so right here. Just uncomment the next line and replace the fixture
+ # names with your fixtures.
+ #
+ # config.global_fixtures = :table_a, :table_b
+ #
+ # If you declare global fixtures, be aware that they will be declared
+ # for all of your examples, even those that don't use them.
+ #
+ # You can also declare which fixtures to use (for example fixtures for test/fixtures):
+ #
+ # config.fixture_path = RAILS_ROOT + '/spec/fixtures/'
+ #
+ # == Mock Framework
+ #
+ # RSpec uses it's own mocking framework by default. If you prefer to
+ # use mocha, flexmock or RR, uncomment the appropriate line:
+ #
+ # config.mock_with :mocha
+ # config.mock_with :flexmock
+ # config.mock_with :rr
+ #
+ # == Notes
+ #
+ # For more information take a look at Spec::Example::Configuration and Spec::Runner
+end
View
0  ...ails/generators/rspec/templates/stories_helper.rb → ...ails/generators/rspec/templates/stories_helper.rb
File renamed without changes
View
0  .../rspec_on_rails/generators/rspec_controller/USAGE → ...ins/rspec-rails/generators/rspec_controller/USAGE 100644 → 100755
File renamed without changes
View
0  ...rs/rspec_controller/rspec_controller_generator.rb → ...rs/rspec_controller/rspec_controller_generator.rb 100644 → 100755
File renamed without changes
View
25 vendor/plugins/rspec-rails/generators/rspec_controller/templates/controller_spec.rb
@@ -0,0 +1,25 @@
+require File.expand_path(File.dirname(__FILE__) + '<%= '/..' * class_nesting_depth %>/../spec_helper')
+
+describe <%= class_name %>Controller do
+
+<% if actions.empty? -%>
+ #Delete this example and add some real ones
+<% else -%>
+ #Delete these examples and add some real ones
+<% end -%>
+ it "should use <%= class_name %>Controller" do
+ controller.should be_an_instance_of(<%= class_name %>Controller)
+ end
+
+<% unless actions.empty? -%>
+<% for action in actions -%>
+
+ describe "GET '<%= action %>'" do
+ it "should be successful" do
+ get '<%= action %>'
+ response.should be_success
+ end
+ end
+<% end -%>
+<% end -%>
+end
View
11 vendor/plugins/rspec-rails/generators/rspec_controller/templates/helper_spec.rb
@@ -0,0 +1,11 @@
+require File.expand_path(File.dirname(__FILE__) + '<%= '/..' * class_nesting_depth %>/../spec_helper')
+
+describe <%= class_name %>Helper do
+
+ #Delete this example and add some real ones or delete this file
+ it "should be included in the object returned by #helper" do
+ included_modules = (class << helper; self; end).send :included_modules
+ included_modules.should include(<%= class_name %>Helper)
+ end
+
+end
View
12 vendor/plugins/rspec-rails/generators/rspec_controller/templates/view_spec.rb
@@ -0,0 +1,12 @@
+require File.expand_path(File.dirname(__FILE__) + '<%= '/..' * class_nesting_depth %>/../../spec_helper')
+
+describe "/<%= class_name.underscore %>/<%= action %>" do
+ before(:each) do
+ render '<%= class_name.underscore %>/<%= action %>'
+ end
+
+ #Delete this example and add some real ones or delete this file
+ it "should tell you where to find the file" do
+ response.should have_tag('p', %r[Find me in app/views/<%= class_name.underscore %>/<%= action %>])
+ end
+end
View
19 vendor/plugins/rspec-rails/generators/rspec_default_values.rb
@@ -0,0 +1,19 @@
+module Rails
+ module Generator
+ class GeneratedAttribute
+ def default_value
+ @default_value ||= case type
+ when :int, :integer then "\"1\""
+ when :float then "\"1.5\""
+ when :decimal then "\"9.99\""
+ when :datetime, :timestamp, :time then "Time.now"
+ when :date then "Date.today"
+ when :string, :text then "\"value for #{@name}\""
+ when :boolean then "false"
+ else
+ ""
+ end
+ end
+ end
+ end
+end
View
0  ...ugins/rspec_on_rails/generators/rspec_model/USAGE → .../plugins/rspec-rails/generators/rspec_model/USAGE 100644 → 100755
File renamed without changes
View
35 vendor/plugins/rspec-rails/generators/rspec_model/rspec_model_generator.rb
@@ -0,0 +1,35 @@
+require 'rails_generator/generators/components/model/model_generator'
+require File.dirname(__FILE__) + '/../rspec_default_values'
+
+class RspecModelGenerator < ModelGenerator
+
+ def manifest
+
+ record do |m|
+ # Check for class naming collisions.
+ m.class_collisions class_path, class_name
+
+ # Model, spec, and fixture directories.
+ m.directory File.join('app/models', class_path)
+ m.directory File.join('spec/models', class_path)
+ unless options[:skip_fixture]
+ m.directory File.join('spec/fixtures', class_path)
+ end
+
+ # Model class, spec and fixtures.
+ m.template 'model:model.rb', File.join('app/models', class_path, "#{file_name}.rb")
+ m.template 'model_spec.rb', File.join('spec/models', class_path, "#{file_name}_spec.rb")
+ unless options[:skip_fixture]
+ m.template 'model:fixtures.yml', File.join('spec/fixtures', "#{table_name}.yml")
+ end
+
+ unless options[:skip_migration]
+ m.migration_template 'model:migration.rb', 'db/migrate', :assigns => {
+ :migration_name => "Create#{class_name.pluralize.gsub(/::/, '')}"
+ }, :migration_file_name => "create_#{file_path.gsub(/\//, '_').pluralize}"
+ end
+
+ end
+ end
+
+end
View
15 vendor/plugins/rspec-rails/generators/rspec_model/templates/model_spec.rb
@@ -0,0 +1,15 @@
+require File.expand_path(File.dirname(__FILE__) + '<%= '/..' * class_nesting_depth %>/../spec_helper')
+
+describe <%= class_name %> do
+ before(:each) do
+ @valid_attributes = {
+<% attributes.each_with_index do |attribute, attribute_index| -%>
+ :<%= attribute.name %> => <%= attribute.default_value %><%= attribute_index == attributes.length - 1 ? '' : ','%>
+<% end -%>
+ }
+ end
+
+ it "should create a new instance given valid attributes" do
+ <%= class_name %>.create!(@valid_attributes)
+ end
+end
View
154 vendor/plugins/rspec-rails/generators/rspec_scaffold/rspec_scaffold_generator.rb
@@ -0,0 +1,154 @@
+require File.dirname(__FILE__) + '/../rspec_default_values'
+
+class RspecScaffoldGenerator < Rails::Generator::NamedBase
+ default_options :skip_migration => false
+
+ attr_reader :controller_name,
+ :controller_class_path,
+ :controller_file_path,
+ :controller_class_nesting,
+ :controller_class_nesting_depth,
+ :controller_class_name,
+ :controller_singular_name,
+ :controller_plural_name,
+ :resource_edit_path,
+ :default_file_extension
+ alias_method :controller_file_name, :controller_singular_name
+ alias_method :controller_table_name, :controller_plural_name
+
+ def initialize(runtime_args, runtime_options = {})
+ super
+
+ @controller_name = @name.pluralize
+
+ base_name, @controller_class_path, @controller_file_path, @controller_class_nesting, @controller_class_nesting_depth = extract_modules(@controller_name)
+ @controller_class_name_without_nesting, @controller_singular_name, @controller_plural_name = inflect_names(base_name)
+
+ if @controller_class_nesting.empty?
+ @controller_class_name = @controller_class_name_without_nesting
+ else
+ @controller_class_name = "#{@controller_class_nesting}::#{@controller_class_name_without_nesting}"
+ end
+
+ if Rails::VERSION::STRING < "2.0.0"
+ @resource_generator = "scaffold_resource"
+ @default_file_extension = "rhtml"
+ else
+ @resource_generator = "scaffold"
+ @default_file_extension = "html.erb"
+ end
+
+ if ActionController::Base.respond_to?(:resource_action_separator)
+ @resource_edit_path = "/edit"
+ else
+ @resource_edit_path = ";edit"
+ end
+ end
+
+ def manifest
+ record do |m|
+
+ # Check for class naming collisions.
+ m.class_collisions(controller_class_path, "#{controller_class_name}Controller", "#{controller_class_name}Helper")
+ m.class_collisions(class_path, "#{class_name}")
+
+ # Controller, helper, views, and spec directories.
+ m.directory(File.join('app/models', class_path))
+ m.directory(File.join('app/controllers', controller_class_path))
+ m.directory(File.join('app/helpers', controller_class_path))
+ m.directory(File.join('app/views', controller_class_path, controller_file_name))
+ m.directory(File.join('spec/controllers', controller_class_path))
+ m.directory(File.join('spec/models', class_path))
+ m.directory(File.join('spec/helpers', class_path))
+ m.directory File.join('spec/fixtures', class_path)
+ m.directory File.join('spec/views', controller_class_path, controller_file_name)
+
+ # Controller spec, class, and helper.
+ m.template 'rspec_scaffold:routing_spec.rb',
+ File.join('spec/controllers', controller_class_path, "#{controller_file_name}_routing_spec.rb")
+
+ m.template 'rspec_scaffold:controller_spec.rb',
+ File.join('spec/controllers', controller_class_path, "#{controller_file_name}_controller_spec.rb")
+
+ m.template "#{@resource_generator}:controller.rb",
+ File.join('app/controllers', controller_class_path, "#{controller_file_name}_controller.rb")
+
+ m.template 'rspec_scaffold:helper_spec.rb',
+ File.join('spec/helpers', class_path, "#{controller_file_name}_helper_spec.rb")
+
+ m.template "#{@resource_generator}:helper.rb",
+ File.join('app/helpers', controller_class_path, "#{controller_file_name}_helper.rb")
+
+ for action in scaffold_views
+ m.template(
+ "#{@resource_generator}:view_#{action}.#{@default_file_extension}",
+ File.join('app/views', controller_class_path, controller_file_name, "#{action}.#{default_file_extension}")
+ )
+ end
+
+ # Model class, unit test, and fixtures.
+ m.template 'model:model.rb', File.join('app/models', class_path, "#{file_name}.rb")
+ m.template 'model:fixtures.yml', File.join('spec/fixtures', class_path, "#{table_name}.yml")
+ m.template 'rspec_model:model_spec.rb', File.join('spec/models', class_path, "#{file_name}_spec.rb")
+
+ # View specs
+ m.template "rspec_scaffold:edit_erb_spec.rb",
+ File.join('spec/views', controller_class_path, controller_file_name, "edit.#{default_file_extension}_spec.rb")
+ m.template "rspec_scaffold:index_erb_spec.rb",
+ File.join('spec/views', controller_class_path, controller_file_name, "index.#{default_file_extension}_spec.rb")
+ m.template "rspec_scaffold:new_erb_spec.rb",
+ File.join('spec/views', controller_class_path, controller_file_name, "new.#{default_file_extension}_spec.rb")
+ m.template "rspec_scaffold:show_erb_spec.rb",
+ File.join('spec/views', controller_class_path, controller_file_name, "show.#{default_file_extension}_spec.rb")
+
+ unless options[:skip_migration]
+ m.migration_template(
+ 'model:migration.rb', 'db/migrate',
+ :assigns => {
+ :migration_name => "Create#{class_name.pluralize.gsub(/::/, '')}",
+ :attributes => attributes
+ },
+ :migration_file_name => "create_#{file_path.gsub(/\//, '_').pluralize}"
+ )
+ end
+
+ m.route_resources controller_file_name
+
+ end
+ end
+
+ protected
+ # Override with your own usage banner.
+ def banner
+ "Usage: #{$0} rspec_scaffold ModelName [field:type field:type]"
+ end
+
+ def add_options!(opt)
+ opt.separator ''
+ opt.separator 'Options:'
+ opt.on("--skip-migration",
+ "Don't generate a migration file for this model") { |v| options[:skip_migration] = v }
+ end
+
+ def scaffold_views
+ %w[ index show new edit ]
+ end
+
+ def model_name
+ class_name.demodulize
+ end
+end
+
+module Rails
+ module Generator
+ class GeneratedAttribute
+ def input_type
+ @input_type ||= case type
+ when :text then "textarea"
+ else
+ "input"
+ end
+ end
+ end
+ end
+end
View
173 vendor/plugins/rspec-rails/generators/rspec_scaffold/templates/controller_spec.rb
@@ -0,0 +1,173 @@
+require File.expand_path(File.dirname(__FILE__) + '<%= '/..' * class_nesting_depth %>/../spec_helper')
+
+describe <%= controller_class_name %>Controller do
+
+ def mock_<%= file_name %>(stubs={})
+ @mock_<%= file_name %> ||= mock_model(<%= class_name %>, stubs)
+ end
+
+ describe "responding to GET index" do
+
+ it "should expose all <%= table_name.pluralize %> as @<%= table_name.pluralize %>" do
+ <%= class_name %>.should_receive(:find).with(:all).and_return([mock_<%= file_name %>])
+ get :index
+ assigns[:<%= table_name %>].should == [mock_<%= file_name %>]
+ end
+
+ describe "with mime type of xml" do
+
+ it "should render all <%= table_name.pluralize %> as xml" do
+ request.env["HTTP_ACCEPT"] = "application/xml"
+ <%= class_name %>.should_receive(:find).with(:all).and_return(<%= file_name.pluralize %> = mock("Array of <%= class_name.pluralize %>"))
+ <%= file_name.pluralize %>.should_receive(:to_xml).and_return("generated XML")
+ get :index
+ response.body.should == "generated XML"
+ end
+
+ end
+
+ end
+
+ describe "responding to GET show" do
+
+ it "should expose the requested <%= file_name %> as @<%= file_name %>" do
+ <%= class_name %>.should_receive(:find).with("37").and_return(mock_<%= file_name %>)
+ get :show, :id => "37"
+ assigns[:<%= file_name %>].should equal(mock_<%= file_name %>)
+ end
+
+ describe "with mime type of xml" do
+
+ it "should render the requested <%= file_name %> as xml" do
+ request.env["HTTP_ACCEPT"] = "application/xml"
+ <%= class_name %>.should_receive(:find).with("37").and_return(mock_<%= file_name %>)
+ mock_<%= file_name %>.should_receive(:to_xml).and_return("generated XML")
+ get :show, :id => "37"
+ response.body.should == "generated XML"
+ end
+
+ end
+
+ end
+
+ describe "responding to GET new" do
+
+ it "should expose a new <%= file_name %> as @<%= file_name %>" do
+ <%= class_name %>.should_receive(:new).and_return(mock_<%= file_name %>)
+ get :new
+ assigns[:<%= file_name %>].should equal(mock_<%= file_name %>)
+ end
+
+ end
+
+ describe "responding to GET edit" do
+
+ it "should expose the requested <%= file_name %> as @<%= file_name %>" do
+ <%= class_name %>.should_receive(:find).with("37").and_return(mock_<%= file_name %>)
+ get :edit, :id => "37"
+ assigns[:<%= file_name %>].should equal(mock_<%= file_name %>)
+ end
+
+ end
+
+ describe "responding to POST create" do
+
+ describe "with valid params" do
+
+ it "should expose a newly created <%= file_name %> as @<%= file_name %>" do
+ <%= class_name %>.should_receive(:new).with({'these' => 'params'}).and_return(mock_<%= file_name %>(:save => true))
+ post :create, :<%= file_name %> => {:these => 'params'}
+ assigns(:<%= file_name %>).should equal(mock_<%= file_name %>)
+ end
+
+ it "should redirect to the created <%= file_name %>" do
+ <%= class_name %>.stub!(:new).and_return(mock_<%= file_name %>(:save => true))
+ post :create, :<%= file_name %> => {}
+ response.should redirect_to(<%= table_name.singularize %>_url(mock_<%= file_name %>))
+ end
+
+ end
+
+ describe "with invalid params" do
+
+ it "should expose a newly created but unsaved <%= file_name %> as @<%= file_name %>" do
+ <%= class_name %>.stub!(:new).with({'these' => 'params'}).and_return(mock_<%= file_name %>(:save => false))
+ post :create, :<%= file_name %> => {:these => 'params'}
+ assigns(:<%= file_name %>).should equal(mock_<%= file_name %>)
+ end
+
+ it "should re-render the 'new' template" do
+ <%= class_name %>.stub!(:new).and_return(mock_<%= file_name %>(:save => false))
+ post :create, :<%= file_name %> => {}
+ response.should render_template('new')
+ end
+
+ end
+
+ end
+
+ describe "responding to PUT udpate" do
+
+ describe "with valid params" do
+
+ it "should update the requested <%= file_name %>" do
+ <%= class_name %>.should_receive(:find).with("37").and_return(mock_<%= file_name %>)
+ mock_<%= file_name %>.should_receive(:update_attributes).with({'these' => 'params'})
+ put :update, :id => "37", :<%= file_name %> => {:these => 'params'}
+ end
+
+ it "should expose the requested <%= file_name %> as @<%= file_name %>" do
+ <%= class_name %>.stub!(:find).and_return(mock_<%= file_name %>(:update_attributes => true))
+ put :update, :id => "1"
+ assigns(:<%= file_name %>).should equal(mock_<%= file_name %>)
+ end
+
+ it "should redirect to the <%= file_name %>" do
+ <%= class_name %>.stub!(:find).and_return(mock_<%= file_name %>(:update_attributes => true))
+ put :update, :id => "1"
+ response.should redirect_to(<%= table_name.singularize %>_url(mock_<%= file_name %>))
+ end
+
+ end
+
+ describe "with invalid params" do
+
+ it "should update the requested <%= file_name %>" do
+ <%= class_name %>.should_receive(:find).with("37").and_return(mock_<%= file_name %>)
+ mock_<%= file_name %>.should_receive(:update_attributes).with({'these' => 'params'})
+ put :update, :id => "37", :<%= file_name %> => {:these => 'params'}
+ end
+
+ it "should expose the <%= file_name %> as @<%= file_name %>" do
+ <%= class_name %>.stub!(:find).and_return(mock_<%= file_name %>(:update_attributes => false))
+ put :update, :id => "1"
+ assigns(:<%= file_name %>).should equal(mock_<%= file_name %>)
+ end
+
+ it "should re-render the 'edit' template" do
+ <%= class_name %>.stub!(:find).and_return(mock_<%= file_name %>(:update_attributes => false))
+ put :update, :id => "1"
+ response.should render_template('edit')
+ end
+
+ end
+
+ end
+
+ describe "responding to DELETE destroy" do
+
+ it "should destroy the requested <%= file_name %>" do
+ <%= class_name %>.should_receive(:find).with("37").and_return(mock_<%= file_name %>)
+ mock_<%= file_name %>.should_receive(:destroy)
+ delete :destroy, :id => "37"
+ end
+
+ it "should redirect to the <%= table_name %> list" do
+ <%= class_name %>.stub!(:find).and_return(mock_<%= file_name %>(:destroy => true))
+ delete :destroy, :id => "1"
+ response.should redirect_to(<%= table_name %>_url)
+ end
+
+ end
+
+end
View
26 vendor/plugins/rspec-rails/generators/rspec_scaffold/templates/edit_erb_spec.rb
@@ -0,0 +1,26 @@
+require File.expand_path(File.dirname(__FILE__) + '<%= '/..' * class_nesting_depth %>/../../spec_helper')
+
+describe "/<%= table_name %>/edit.<%= default_file_extension %>" do
+ include <%= controller_class_name %>Helper
+
+ before(:each) do
+ assigns[:<%= file_name %>] = @<%= file_name %> = stub_model(<%= class_name %>,
+ :new_record? => false<%= attributes.empty? ? '' : ',' %>
+<% attributes.each_with_index do |attribute, attribute_index| -%><% unless attribute.name =~ /_id/ || [:datetime, :timestamp, :time, :date].index(attribute.type) -%>
+ :<%= attribute.name %> => <%= attribute.default_value %><%= attribute_index == attributes.length - 1 ? '' : ','%>
+<% end -%><% end -%>
+ )
+ end
+
+ it "should render edit form" do
+ render "/<%= table_name %>/edit.<%= default_file_extension %>"
+
+ response.should have_tag("form[action=#{<%= file_name %>_path(@<%= file_name %>)}][method=post]") do
+<% for attribute in attributes -%><% unless attribute.name =~ /_id/ || [:datetime, :timestamp, :time, :date].index(attribute.type) -%>
+ with_tag('<%= attribute.input_type -%>#<%= file_name %>_<%= attribute.name %>[name=?]', "<%= file_name %>[<%= attribute.name %>]")
+<% end -%><% end -%>
+ end
+ end
+end
+
+
View
11 vendor/plugins/rspec-rails/generators/rspec_scaffold/templates/helper_spec.rb
@@ -0,0 +1,11 @@
+require File.expand_path(File.dirname(__FILE__) + '<%= '/..' * class_nesting_depth %>/../spec_helper')
+
+describe <%= controller_class_name %>Helper do
+
+ #Delete this example and add some real ones or delete this file
+ it "should be included in the object returned by #helper" do
+ included_modules = (class << helper; self; end).send :included_modules
+ included_modules.should include(<%= controller_class_name %>Helper)
+ end
+
+end
View
27 vendor/plugins/rspec-rails/generators/rspec_scaffold/templates/index_erb_spec.rb
@@ -0,0 +1,27 @@
+require File.expand_path(File.dirname(__FILE__) + '<%= '/..' * class_nesting_depth %>/../../spec_helper')
+
+describe "/<%= table_name %>/index.<%= default_file_extension %>" do
+ include <%= controller_class_name %>Helper
+
+ before(:each) do
+ assigns[:<%= table_name %>] = [
+<% [1,2].each_with_index do |id, model_index| -%>
+ stub_model(<%= class_name %><%= attributes.empty? ? (model_index == 1 ? ')' : '),') : ',' %>
+<% attributes.each_with_index do |attribute, attribute_index| -%><% unless attribute.name =~ /_id/ || [:datetime, :timestamp, :time, :date].index(attribute.type) -%>
+ :<%= attribute.name %> => <%= attribute.default_value %><%= attribute_index == attributes.length - 1 ? '' : ','%>
+<% end -%><% end -%>
+<% if !attributes.empty? -%>
+ <%= model_index == 1 ? ')' : '),' %>
+<% end -%>
+<% end -%>
+ ]
+ end
+
+ it "should render list of <%= table_name %>" do
+ render "/<%= table_name %>/index.<%= default_file_extension %>"
+<% for attribute in attributes -%><% unless attribute.name =~ /_id/ || [:datetime, :timestamp, :time, :date].index(attribute.type) -%>
+ response.should have_tag("tr>td", <%= attribute.default_value %>, 2)
+<% end -%><% end -%>
+ end
+end
+
View
26 vendor/plugins/rspec-rails/generators/rspec_scaffold/templates/new_erb_spec.rb
@@ -0,0 +1,26 @@
+require File.expand_path(File.dirname(__FILE__) + '<%= '/..' * class_nesting_depth %>/../../spec_helper')
+
+describe "/<%= table_name %>/new.<%= default_file_extension %>" do
+ include <%= controller_class_name %>Helper
+
+ before(:each) do
+ assigns[:<%= file_name %>] = stub_model(<%= class_name %>,
+ :new_record? => true<%= attributes.empty? ? '' : ',' %>
+<% attributes.each_with_index do |attribute, attribute_index| -%><% unless attribute.name =~ /_id/ || [:datetime, :timestamp, :time, :date].index(attribute.type) -%>
+ :<%= attribute.name %> => <%= attribute.default_value %><%= attribute_index == attributes.length - 1 ? '' : ','%>
+<% end -%><% end -%>
+ )
+ end
+
+ it "should render new form" do
+ render "/<%= table_name %>/new.<%= default_file_extension %>"
+
+ response.should have_tag("form[action=?][method=post]", <%= table_name %>_path) do
+<% for attribute in attributes -%><% unless attribute.name =~ /_id/ || [:datetime, :timestamp, :time, :date].index(attribute.type) -%>
+ with_tag("<%= attribute.input_type -%>#<%= file_name %>_<%= attribute.name %>[name=?]", "<%= file_name %>[<%= attribute.name %>]")
+<% end -%><% end -%>
+ end
+ end
+end
+
+
View
59 vendor/plugins/rspec-rails/generators/rspec_scaffold/templates/routing_spec.rb
@@ -0,0 +1,59 @@
+require File.expand_path(File.dirname(__FILE__) + '<%= '/..' * class_nesting_depth %>/../spec_helper')
+
+describe <%= controller_class_name %>Controller do
+ describe "route generation" do
+ it "should map #index" do
+ route_for(:controller => "<%= table_name %>", :action => "index").should == "/<%= table_name %>"
+ end
+
+ it "should map #new" do
+ route_for(:controller => "<%= table_name %>", :action => "new").should == "/<%= table_name %>/new"
+ end
+
+ it "should map #show" do
+ route_for(:controller => "<%= table_name %>", :action => "show", :id => 1).should == "/<%= table_name %>/1"
+ end
+
+ it "should map #edit" do
+ route_for(:controller => "<%= table_name %>", :action => "edit", :id => 1).should == "/<%= table_name %>/1<%= resource_edit_path %>"
+ end
+
+ it "should map #update" do
+ route_for(:controller => "<%= table_name %>", :action => "update", :id => 1).should == "/<%= table_name %>/1"
+ end
+
+ it "should map #destroy" do
+ route_for(:controller => "<%= table_name %>", :action => "destroy", :id => 1).should == "/<%= table_name %>/1"
+ end
+ end
+
+ describe "route recognition" do
+ it "should generate params for #index" do
+ params_from(:get, "/<%= table_name %>").should == {:controller => "<%= table_name %>", :action => "index"}
+ end
+
+ it "should generate params for #new" do
+ params_from(:get, "/<%= table_name %>/new").should == {:controller => "<%= table_name %>", :action => "new"}
+ end
+
+ it "should generate params for #create" do
+ params_from(:post, "/<%= table_name %>").should == {:controller => "<%= table_name %>", :action => "create"}
+ end
+
+ it "should generate params for #show" do
+ params_from(:get, "/<%= table_name %>/1").should == {:controller => "<%= table_name %>", :action => "show", :id => "1"}
+ end
+
+ it "should generate params for #edit" do
+ params_from(:get, "/<%= table_name %>/1<%= resource_edit_path %>").should == {:controller => "<%= table_name %>", :action => "edit", :id => "1"}
+ end
+
+ it "should generate params for #update" do
+ params_from(:put, "/<%= table_name %>/1").should == {:controller => "<%= table_name %>", :action => "update", :id => "1"}
+ end
+
+ it "should generate params for #destroy" do
+ params_from(:delete, "/<%= table_name %>/1").should == {:controller => "<%= table_name %>", :action => "destroy", :id => "1"}
+ end
+ end
+end
View
23 vendor/plugins/rspec-rails/generators/rspec_scaffold/templates/show_erb_spec.rb
@@ -0,0 +1,23 @@
+require File.expand_path(File.dirname(__FILE__) + '<%= '/..' * class_nesting_depth %>/../../spec_helper')
+
+describe "/<%= table_name %>/show.<%= default_file_extension %>" do
+ include <%= controller_class_name %>Helper
+
+ before(:each) do
+ assigns[:<%= file_name %>] = @<%= file_name %> = stub_model(<%= class_name %><%= attributes.empty? ? ')' : ',' %>
+<% attributes.each_with_index do |attribute, attribute_index| -%><% unless attribute.name =~ /_id/ || [:datetime, :timestamp, :time, :date].index(attribute.type) -%>
+ :<%= attribute.name %> => <%= attribute.default_value %><%= attribute_index == attributes.length - 1 ? '' : ','%>
+<% end -%><% end -%>
+<% if !attributes.empty? -%>
+ )
+<% end -%>
+ end
+
+ it "should render attributes in <p>" do
+ render "/<%= table_name %>/show.<%= default_file_extension %>"
+<% for attribute in attributes -%><% unless attribute.name =~ /_id/ || [:datetime, :timestamp, :time, :date].index(attribute.type) -%>
+ response.should have_text(/<%= Regexp.escape(attribute.default_value)[1..-2]%>/)
+<% end -%><% end -%>
+ end
+end
+
View
0  vendor/plugins/rspec_on_rails/init.rb → vendor/plugins/rspec-rails/init.rb
File renamed without changes
View
0  ...r/plugins/rspec_on_rails/lib/autotest/discover.rb → vendor/plugins/rspec-rails/lib/autotest/discover.rb
File renamed without changes
View
76 vendor/plugins/rspec-rails/lib/autotest/rails_rspec.rb
@@ -0,0 +1,76 @@
+# (c) Copyright 2006 Nick Sieger <nicksieger@gmail.com>
+#
+# Permission is hereby granted, free of charge, to any person
+# obtaining a copy of this software and associated documentation files
+# (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, sublicense, and/or sell copies of the Software,
+# and to permit persons to whom the Software is furnished to do so,
+# subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+$:.push(*Dir["vendor/rails/*/lib"])
+
+require 'active_support'
+require 'autotest/rspec'
+
+Autotest.add_hook :initialize do |at|
+ %w{config/ coverage/ db/ doc/ log/ public/ script/ tmp/ vendor/rails vendor/plugins previous_failures.txt}.each do |exception|
+ at.add_exception(exception)
+ end
+
+ at.clear_mappings
+
+ at.add_mapping(%r%^(test|spec)/fixtures/(.*).yml$%) { |_, m|
+ ["spec/models/#{m[2].singularize}_spec.rb"] + at.files_matching(%r%^spec\/views\/#{m[2]}/.*_spec\.rb$%)
+ }
+ at.add_mapping(%r%^spec/(models|controllers|views|helpers|lib)/.*rb$%) { |filename, _|
+ filename
+ }
+ at.add_mapping(%r%^app/models/(.*)\.rb$%) { |_, m|
+ ["spec/models/#{m[1]}_spec.rb"]
+ }
+ at.add_mapping(%r%^app/views/(.*)$%) { |_, m|
+ at.files_matching %r%^spec/views/#{m[1]}_spec.rb$%
+ }
+ at.add_mapping(%r%^app/controllers/(.*)\.rb$%) { |_, m|
+ if m[1] == "application"
+ at.files_matching %r%^spec/controllers/.*_spec\.rb$%
+ else
+ ["spec/controllers/#{m[1]}_spec.rb"]
+ end
+ }
+ at.add_mapping(%r%^app/helpers/(.*)_helper\.rb$%) { |_, m|
+ if m[1] == "application" then
+ at.files_matching(%r%^spec/(views|helpers)/.*_spec\.rb$%)
+ else
+ ["spec/helpers/#{m[1]}_helper_spec.rb"] + at.files_matching(%r%^spec\/views\/#{m[1]}/.*_spec\.rb$%)
+ end
+ }
+ at.add_mapping(%r%^config/routes\.rb$%) {
+ at.files_matching %r%^spec/(controllers|views|helpers)/.*_spec\.rb$%
+ }
+ at.add_mapping(%r%^config/database\.yml$%) { |_, m|
+ at.files_matching %r%^spec/models/.*_spec\.rb$%
+ }
+ at.add_mapping(%r%^(spec/(spec_helper|shared/.*)|config/(boot|environment(s/test)?))\.rb$%) {
+ at.files_matching %r%^spec/(models|controllers|views|helpers)/.*_spec\.rb$%
+ }
+ at.add_mapping(%r%^lib/(.*)\.rb$%) { |_, m|
+ ["spec/lib/#{m[1]}_spec.rb"]
+ }
+end
+
+class Autotest::RailsRspec < Autotest::Rspec
+end
View
15 vendor/plugins/rspec-rails/lib/spec/rails.rb
@@ -0,0 +1,15 @@
+silence_warnings { RAILS_ENV = "test" }
+
+require_dependency 'application'
+require 'action_controller/test_process'
+require 'action_controller/integration'
+require 'active_record/fixtures' if defined?(ActiveRecord::Base)
+require 'test/unit'
+
+require 'spec'
+
+require 'spec/rails/matchers'
+require 'spec/rails/mocks'
+require 'spec/rails/example'
+require 'spec/rails/extensions'
+require 'spec/rails/interop/testcase'
View
47 vendor/plugins/rspec-rails/lib/spec/rails/example.rb
@@ -0,0 +1,47 @@
+dir = File.dirname(__FILE__)
+
+require 'spec/rails/example/assigns_hash_proxy'
+
+require "spec/rails/example/render_observer"
+require "spec/rails/example/rails_example_group"
+require "spec/rails/example/model_example_group"
+require "spec/rails/example/functional_example_group"
+require "spec/rails/example/controller_example_group"
+require "spec/rails/example/helper_example_group"
+require "spec/rails/example/view_example_group"
+require "spec/rails/example/cookies_proxy"
+
+module Spec
+ module Rails
+ # Spec::Rails::Example extends Spec::Example (RSpec's core Example module) to provide
+ # Rails-specific contexts for describing Rails Models, Views, Controllers and Helpers.
+ #
+ # == Model Examples
+ #
+ # These are the equivalent of unit tests in Rails' built in testing. Ironically (for the traditional TDD'er) these are the only specs that we feel should actually interact with the database.
+ #
+ # See Spec::Rails::Example::ModelExampleGroup
+ #
+ # == Controller Examples
+ #
+ # These align somewhat with functional tests in rails, except that they do not actually render views (though you can force rendering of views if you prefer). Instead of setting expectations about what goes on a page, you set expectations about what templates get rendered.
+ #
+ # See Spec::Rails::Example::ControllerExampleGroup
+ #
+ # == View Examples
+ #
+ # This is the other half of Rails functional testing. View specs allow you to set up assigns and render
+ # a template. By assigning mock model data, you can specify view behaviour with no dependency on a database
+ # or your real models.
+ #
+ # See Spec::Rails::Example::ViewExampleGroup
+ #
+ # == Helper Examples
+ #
+ # These let you specify directly methods that live in your helpers.
+ #
+ # See Spec::Rails::Example::HelperExampleGroup
+ module Example
+ end
+ end
+end
View
43 vendor/plugins/rspec-rails/lib/spec/rails/example/assigns_hash_proxy.rb
@@ -0,0 +1,43 @@
+module Spec
+ module Rails
+ module Example
+ class AssignsHashProxy #:nodoc:
+ def initialize(example_group, &block)
+ @block = block
+ @example_group = example_group
+ end
+
+ def [](ivar)
+ if assigns.include?(ivar.to_s)
+ assigns[ivar.to_s]
+ elsif assigns.include?(ivar)
+ assigns[ivar]
+ else
+ nil
+ end
+ end
+
+ def []=(ivar, val)
+ @block.call.instance_variable_set("@#{ivar}", val)
+ end
+
+ def delete(name)
+ assigns.delete(name.to_s)
+ end
+
+