Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

All unit tests now run in Rails 2.3.2.

  • Loading branch information...
commit 3406e93f2d91ab8b70ad5ba016615c2b3f0c3501 1 parent 1cb9555
bguthrie authored
Showing with 32,231 additions and 0 deletions.
  1. +14 −0 app/controllers/application_controller.rb
  2. +22 −0 config/database.yml
  3. +7 −0 config/initializers/backtrace_silencers.rb
  4. +10 −0 config/initializers/inflections.rb
  5. +5 −0 config/initializers/mime_types.rb
  6. +19 −0 config/initializers/new_rails_defaults.rb
  7. +15 −0 config/initializers/session_store.rb
  8. +5 −0 config/locales/en.yml
  9. +2 −0  doc/README_FOR_APP
  10. +30 −0 public/422.html
  11. +3 −0  script/dbconsole
  12. +9 −0 test/performance/browsing_test.rb
  13. +3 −0  vendor/gems/mocha-0.9.5/COPYING
  14. +7 −0 vendor/gems/mocha-0.9.5/MIT-LICENSE
  15. +37 −0 vendor/gems/mocha-0.9.5/README
  16. +269 −0 vendor/gems/mocha-0.9.5/RELEASE
  17. +207 −0 vendor/gems/mocha-0.9.5/Rakefile
  18. +44 −0 vendor/gems/mocha-0.9.5/examples/misc.rb
  19. +26 −0 vendor/gems/mocha-0.9.5/examples/mocha.rb
  20. +65 −0 vendor/gems/mocha-0.9.5/examples/stubba.rb
  21. +49 −0 vendor/gems/mocha-0.9.5/lib/mocha.rb
  22. +55 −0 vendor/gems/mocha-0.9.5/lib/mocha/any_instance_method.rb
  23. +21 −0 vendor/gems/mocha-0.9.5/lib/mocha/argument_iterator.rb
  24. +17 −0 vendor/gems/mocha-0.9.5/lib/mocha/backtrace_filter.rb
  25. +95 −0 vendor/gems/mocha-0.9.5/lib/mocha/cardinality.rb
  26. +27 −0 vendor/gems/mocha-0.9.5/lib/mocha/central.rb
  27. +19 −0 vendor/gems/mocha-0.9.5/lib/mocha/change_state_side_effect.rb
  28. +87 −0 vendor/gems/mocha-0.9.5/lib/mocha/class_method.rb
  29. +60 −0 vendor/gems/mocha-0.9.5/lib/mocha/configuration.rb
  30. +22 −0 vendor/gems/mocha-0.9.5/lib/mocha/deprecation.rb
  31. +17 −0 vendor/gems/mocha-0.9.5/lib/mocha/exception_raiser.rb
  32. +476 −0 vendor/gems/mocha-0.9.5/lib/mocha/expectation.rb
  33. +15 −0 vendor/gems/mocha-0.9.5/lib/mocha/expectation_error.rb
  34. +50 −0 vendor/gems/mocha-0.9.5/lib/mocha/expectation_list.rb
  35. +19 −0 vendor/gems/mocha-0.9.5/lib/mocha/in_state_ordering_constraint.rb
  36. +67 −0 vendor/gems/mocha-0.9.5/lib/mocha/inspect.rb
  37. +16 −0 vendor/gems/mocha-0.9.5/lib/mocha/instance_method.rb
  38. +9 −0 vendor/gems/mocha-0.9.5/lib/mocha/is_a.rb
  39. +15 −0 vendor/gems/mocha-0.9.5/lib/mocha/logger.rb
  40. +13 −0 vendor/gems/mocha-0.9.5/lib/mocha/metaclass.rb
  41. +21 −0 vendor/gems/mocha-0.9.5/lib/mocha/method_matcher.rb
  42. +50 −0 vendor/gems/mocha-0.9.5/lib/mocha/mini_test_adapter.rb
  43. +200 −0 vendor/gems/mocha-0.9.5/lib/mocha/mock.rb
  44. +181 −0 vendor/gems/mocha-0.9.5/lib/mocha/mockery.rb
  45. +16 −0 vendor/gems/mocha-0.9.5/lib/mocha/module_method.rb
  46. +20 −0 vendor/gems/mocha-0.9.5/lib/mocha/multiple_yields.rb
  47. +53 −0 vendor/gems/mocha-0.9.5/lib/mocha/names.rb
  48. +11 −0 vendor/gems/mocha-0.9.5/lib/mocha/no_yields.rb
  49. +187 −0 vendor/gems/mocha-0.9.5/lib/mocha/object.rb
  50. +27 −0 vendor/gems/mocha-0.9.5/lib/mocha/parameter_matchers.rb
  51. +42 −0 vendor/gems/mocha-0.9.5/lib/mocha/parameter_matchers/all_of.rb
  52. +47 −0 vendor/gems/mocha-0.9.5/lib/mocha/parameter_matchers/any_of.rb
  53. +40 −0 vendor/gems/mocha-0.9.5/lib/mocha/parameter_matchers/any_parameters.rb
  54. +33 −0 vendor/gems/mocha-0.9.5/lib/mocha/parameter_matchers/anything.rb
  55. +15 −0 vendor/gems/mocha-0.9.5/lib/mocha/parameter_matchers/base.rb
  56. +42 −0 vendor/gems/mocha-0.9.5/lib/mocha/parameter_matchers/equals.rb
  57. +45 −0 vendor/gems/mocha-0.9.5/lib/mocha/parameter_matchers/has_entries.rb
  58. +56 −0 vendor/gems/mocha-0.9.5/lib/mocha/parameter_matchers/has_entry.rb
  59. +42 −0 vendor/gems/mocha-0.9.5/lib/mocha/parameter_matchers/has_key.rb
  60. +42 −0 vendor/gems/mocha-0.9.5/lib/mocha/parameter_matchers/has_value.rb
  61. +40 −0 vendor/gems/mocha-0.9.5/lib/mocha/parameter_matchers/includes.rb
  62. +42 −0 vendor/gems/mocha-0.9.5/lib/mocha/parameter_matchers/instance_of.rb
  63. +42 −0 vendor/gems/mocha-0.9.5/lib/mocha/parameter_matchers/is_a.rb
  64. +42 −0 vendor/gems/mocha-0.9.5/lib/mocha/parameter_matchers/kind_of.rb
  65. +42 −0 vendor/gems/mocha-0.9.5/lib/mocha/parameter_matchers/not.rb
  66. +15 −0 vendor/gems/mocha-0.9.5/lib/mocha/parameter_matchers/object.rb
  67. +55 −0 vendor/gems/mocha-0.9.5/lib/mocha/parameter_matchers/optionally.rb
  68. +43 −0 vendor/gems/mocha-0.9.5/lib/mocha/parameter_matchers/regexp_matches.rb
  69. +43 −0 vendor/gems/mocha-0.9.5/lib/mocha/parameter_matchers/responds_with.rb
  70. +43 −0 vendor/gems/mocha-0.9.5/lib/mocha/parameter_matchers/yaml_equivalent.rb
  71. +37 −0 vendor/gems/mocha-0.9.5/lib/mocha/parameters_matcher.rb
  72. +28 −0 vendor/gems/mocha-0.9.5/lib/mocha/pretty_parameters.rb
  73. +31 −0 vendor/gems/mocha-0.9.5/lib/mocha/return_values.rb
  74. +42 −0 vendor/gems/mocha-0.9.5/lib/mocha/sequence.rb
  75. +17 −0 vendor/gems/mocha-0.9.5/lib/mocha/single_return_value.rb
  76. +18 −0 vendor/gems/mocha-0.9.5/lib/mocha/single_yield.rb
  77. +166 −0 vendor/gems/mocha-0.9.5/lib/mocha/standalone.rb
  78. +91 −0 vendor/gems/mocha-0.9.5/lib/mocha/state_machine.rb
  79. +16 −0 vendor/gems/mocha-0.9.5/lib/mocha/stubbing_error.rb
  80. +103 −0 vendor/gems/mocha-0.9.5/lib/mocha/test_case_adapter.rb
  81. +18 −0 vendor/gems/mocha-0.9.5/lib/mocha/unexpected_invocation.rb
  82. +31 −0 vendor/gems/mocha-0.9.5/lib/mocha/yield_parameters.rb
  83. +2 −0  vendor/gems/mocha-0.9.5/lib/mocha_standalone.rb
  84. +4 −0 vendor/gems/mocha-0.9.5/lib/stubba.rb
  85. +38 −0 vendor/gems/mocha-0.9.5/test/acceptance/acceptance_test_helper.rb
  86. +43 −0 vendor/gems/mocha-0.9.5/test/acceptance/bug_18914_test.rb
  87. +34 −0 vendor/gems/mocha-0.9.5/test/acceptance/bug_21465_test.rb
  88. +25 −0 vendor/gems/mocha-0.9.5/test/acceptance/bug_21563_test.rb
  89. +196 −0 vendor/gems/mocha-0.9.5/test/acceptance/expected_invocation_count_test.rb
  90. +64 −0 vendor/gems/mocha-0.9.5/test/acceptance/failure_messages_test.rb
  91. +130 −0 vendor/gems/mocha-0.9.5/test/acceptance/minitest_test.rb
  92. +98 −0 vendor/gems/mocha-0.9.5/test/acceptance/mocha_example_test.rb
  93. +84 −0 vendor/gems/mocha-0.9.5/test/acceptance/mocha_test_result_test.rb
  94. +100 −0 vendor/gems/mocha-0.9.5/test/acceptance/mock_test.rb
  95. +51 −0 vendor/gems/mocha-0.9.5/test/acceptance/mock_with_initializer_block_test.rb
  96. +78 −0 vendor/gems/mocha-0.9.5/test/acceptance/mocked_methods_dispatch_test.rb
  97. +70 −0 vendor/gems/mocha-0.9.5/test/acceptance/optional_parameters_test.rb
  98. +209 −0 vendor/gems/mocha-0.9.5/test/acceptance/parameter_matcher_test.rb
  99. +47 −0 vendor/gems/mocha-0.9.5/test/acceptance/partial_mocks_test.rb
  100. +52 −0 vendor/gems/mocha-0.9.5/test/acceptance/return_value_test.rb
  101. +186 −0 vendor/gems/mocha-0.9.5/test/acceptance/sequence_test.rb
  102. +139 −0 vendor/gems/mocha-0.9.5/test/acceptance/standalone_test.rb
  103. +70 −0 vendor/gems/mocha-0.9.5/test/acceptance/states_test.rb
  104. +195 −0 vendor/gems/mocha-0.9.5/test/acceptance/stub_any_instance_method_test.rb
  105. +203 −0 vendor/gems/mocha-0.9.5/test/acceptance/stub_class_method_test.rb
  106. +56 −0 vendor/gems/mocha-0.9.5/test/acceptance/stub_everything_test.rb
  107. +203 −0 vendor/gems/mocha-0.9.5/test/acceptance/stub_instance_method_test.rb
  108. +163 −0 vendor/gems/mocha-0.9.5/test/acceptance/stub_module_method_test.rb
  109. +52 −0 vendor/gems/mocha-0.9.5/test/acceptance/stub_test.rb
  110. +102 −0 vendor/gems/mocha-0.9.5/test/acceptance/stubba_example_test.rb
  111. +15 −0 vendor/gems/mocha-0.9.5/test/acceptance/stubba_test.rb
  112. +66 −0 vendor/gems/mocha-0.9.5/test/acceptance/stubba_test_result_test.rb
  113. +64 −0 vendor/gems/mocha-0.9.5/test/acceptance/stubbing_error_backtrace_test.rb
  114. +65 −0 vendor/gems/mocha-0.9.5/test/acceptance/stubbing_method_unnecessarily_test.rb
  115. +130 −0 vendor/gems/mocha-0.9.5/test/acceptance/stubbing_non_existent_any_instance_method_test.rb
  116. +157 −0 vendor/gems/mocha-0.9.5/test/acceptance/stubbing_non_existent_class_method_test.rb
  117. +147 −0 vendor/gems/mocha-0.9.5/test/acceptance/stubbing_non_existent_instance_method_test.rb
  118. +130 −0 vendor/gems/mocha-0.9.5/test/acceptance/stubbing_non_public_any_instance_method_test.rb
  119. +163 −0 vendor/gems/mocha-0.9.5/test/acceptance/stubbing_non_public_class_method_test.rb
  120. +143 −0 vendor/gems/mocha-0.9.5/test/acceptance/stubbing_non_public_instance_method_test.rb
  121. +64 −0 vendor/gems/mocha-0.9.5/test/acceptance/stubbing_on_non_mock_object_test.rb
  122. +15 −0 vendor/gems/mocha-0.9.5/test/deprecation_disabler.rb
  123. +36 −0 vendor/gems/mocha-0.9.5/test/execution_point.rb
  124. +24 −0 vendor/gems/mocha-0.9.5/test/method_definer.rb
  125. +13 −0 vendor/gems/mocha-0.9.5/test/simple_counter.rb
  126. +11 −0 vendor/gems/mocha-0.9.5/test/test_helper.rb
  127. +33 −0 vendor/gems/mocha-0.9.5/test/test_runner.rb
  128. +126 −0 vendor/gems/mocha-0.9.5/test/unit/any_instance_method_test.rb
  129. +16 −0 vendor/gems/mocha-0.9.5/test/unit/array_inspect_test.rb
  130. +19 −0 vendor/gems/mocha-0.9.5/test/unit/backtrace_filter_test.rb
  131. +56 −0 vendor/gems/mocha-0.9.5/test/unit/cardinality_test.rb
  132. +65 −0 vendor/gems/mocha-0.9.5/test/unit/central_test.rb
  133. +41 −0 vendor/gems/mocha-0.9.5/test/unit/change_state_side_effect_test.rb
  134. +237 −0 vendor/gems/mocha-0.9.5/test/unit/class_method_test.rb
  135. +21 −0 vendor/gems/mocha-0.9.5/test/unit/date_time_inspect_test.rb
  136. +42 −0 vendor/gems/mocha-0.9.5/test/unit/exception_raiser_test.rb
  137. +57 −0 vendor/gems/mocha-0.9.5/test/unit/expectation_list_test.rb
  138. +480 −0 vendor/gems/mocha-0.9.5/test/unit/expectation_test.rb
  139. +16 −0 vendor/gems/mocha-0.9.5/test/unit/hash_inspect_test.rb
  140. +43 −0 vendor/gems/mocha-0.9.5/test/unit/in_state_ordering_constraint_test.rb
  141. +22 −0 vendor/gems/mocha-0.9.5/test/unit/metaclass_test.rb
  142. +23 −0 vendor/gems/mocha-0.9.5/test/unit/method_matcher_test.rb
  143. +302 −0 vendor/gems/mocha-0.9.5/test/unit/mock_test.rb
  144. +149 −0 vendor/gems/mocha-0.9.5/test/unit/mockery_test.rb
  145. +18 −0 vendor/gems/mocha-0.9.5/test/unit/multiple_yields_test.rb
  146. +18 −0 vendor/gems/mocha-0.9.5/test/unit/no_yields_test.rb
  147. +37 −0 vendor/gems/mocha-0.9.5/test/unit/object_inspect_test.rb
  148. +82 −0 vendor/gems/mocha-0.9.5/test/unit/object_test.rb
  149. +26 −0 vendor/gems/mocha-0.9.5/test/unit/parameter_matchers/all_of_test.rb
  150. +26 −0 vendor/gems/mocha-0.9.5/test/unit/parameter_matchers/any_of_test.rb
  151. +21 −0 vendor/gems/mocha-0.9.5/test/unit/parameter_matchers/anything_test.rb
  152. +25 −0 vendor/gems/mocha-0.9.5/test/unit/parameter_matchers/equals_test.rb
  153. +51 −0 vendor/gems/mocha-0.9.5/test/unit/parameter_matchers/has_entries_test.rb
  154. +62 −0 vendor/gems/mocha-0.9.5/test/unit/parameter_matchers/has_entry_test.rb
  155. +36 −0 vendor/gems/mocha-0.9.5/test/unit/parameter_matchers/has_key_test.rb
  156. +37 −0 vendor/gems/mocha-0.9.5/test/unit/parameter_matchers/has_value_test.rb
  157. +25 −0 vendor/gems/mocha-0.9.5/test/unit/parameter_matchers/includes_test.rb
  158. +25 −0 vendor/gems/mocha-0.9.5/test/unit/parameter_matchers/instance_of_test.rb
  159. +25 −0 vendor/gems/mocha-0.9.5/test/unit/parameter_matchers/is_a_test.rb
  160. +25 −0 vendor/gems/mocha-0.9.5/test/unit/parameter_matchers/kind_of_test.rb
  161. +26 −0 vendor/gems/mocha-0.9.5/test/unit/parameter_matchers/not_test.rb
  162. +25 −0 vendor/gems/mocha-0.9.5/test/unit/parameter_matchers/regexp_matches_test.rb
  163. +25 −0 vendor/gems/mocha-0.9.5/test/unit/parameter_matchers/responds_with_test.rb
  164. +27 −0 vendor/gems/mocha-0.9.5/test/unit/parameter_matchers/stub_matcher.rb
  165. +25 −0 vendor/gems/mocha-0.9.5/test/unit/parameter_matchers/yaml_equivalent_test.rb
  166. +121 −0 vendor/gems/mocha-0.9.5/test/unit/parameters_matcher_test.rb
  167. +63 −0 vendor/gems/mocha-0.9.5/test/unit/return_values_test.rb
  168. +104 −0 vendor/gems/mocha-0.9.5/test/unit/sequence_test.rb
  169. +14 −0 vendor/gems/mocha-0.9.5/test/unit/single_return_value_test.rb
  170. +18 −0 vendor/gems/mocha-0.9.5/test/unit/single_yield_test.rb
  171. +98 −0 vendor/gems/mocha-0.9.5/test/unit/state_machine_test.rb
  172. +11 −0 vendor/gems/mocha-0.9.5/test/unit/string_inspect_test.rb
  173. +93 −0 vendor/gems/mocha-0.9.5/test/unit/yield_parameters_test.rb
  174. +149 −0 vendor/gems/rcov-0.8.1.2.0/BLURB
  175. +177 −0 vendor/gems/rcov-0.8.1.2.0/CHANGES
  176. +36 −0 vendor/gems/rcov-0.8.1.2.0/LEGAL
  177. +56 −0 vendor/gems/rcov-0.8.1.2.0/LICENSE
  178. +42 −0 vendor/gems/rcov-0.8.1.2.0/README.API
  179. +64 −0 vendor/gems/rcov-0.8.1.2.0/README.emacs
  180. +130 −0 vendor/gems/rcov-0.8.1.2.0/README.en
  181. +62 −0 vendor/gems/rcov-0.8.1.2.0/README.rake
  182. +68 −0 vendor/gems/rcov-0.8.1.2.0/README.rant
  183. +47 −0 vendor/gems/rcov-0.8.1.2.0/README.vim
  184. +168 −0 vendor/gems/rcov-0.8.1.2.0/Rakefile
  185. +76 −0 vendor/gems/rcov-0.8.1.2.0/Rantfile
  186. +96 −0 vendor/gems/rcov-0.8.1.2.0/THANKS
  187. +1,327 −0 vendor/gems/rcov-0.8.1.2.0/bin/rcov
  188. +242 −0 vendor/gems/rcov-0.8.1.2.0/ext/rcovrt/callsite.c
  189. +11 −0 vendor/gems/rcov-0.8.1.2.0/ext/rcovrt/extconf.rb
  190. +329 −0 vendor/gems/rcov-0.8.1.2.0/ext/rcovrt/rcovrt.c
  191. +988 −0 vendor/gems/rcov-0.8.1.2.0/lib/rcov.rb
  192. +147 −0 vendor/gems/rcov-0.8.1.2.0/lib/rcov/lowlevel.rb
  193. +87 −0 vendor/gems/rcov-0.8.1.2.0/lib/rcov/rant.rb
  194. +156 −0 vendor/gems/rcov-0.8.1.2.0/lib/rcov/rcovtask.rb
  195. +1,236 −0 vendor/gems/rcov-0.8.1.2.0/lib/rcov/report.rb
  196. +13 −0 vendor/gems/rcov-0.8.1.2.0/lib/rcov/version.rb
  197. +174 −0 vendor/gems/rcov-0.8.1.2.0/mingw-rbconfig.rb
  198. +131 −0 vendor/gems/rcov-0.8.1.2.0/rcov.el
  199. +38 −0 vendor/gems/rcov-0.8.1.2.0/rcov.vim
  200. +1,585 −0 vendor/gems/rcov-0.8.1.2.0/setup.rb
  201. +7 −0 vendor/gems/rcov-0.8.1.2.0/test/sample_01.rb
  202. +5 −0 vendor/gems/rcov-0.8.1.2.0/test/sample_02.rb
  203. +20 −0 vendor/gems/rcov-0.8.1.2.0/test/sample_03.rb
  204. +10 −0 vendor/gems/rcov-0.8.1.2.0/test/sample_04.rb
  205. +17 −0 vendor/gems/rcov-0.8.1.2.0/test/sample_05-new.rb
  206. +13 −0 vendor/gems/rcov-0.8.1.2.0/test/sample_05-old.rb
  207. +17 −0 vendor/gems/rcov-0.8.1.2.0/test/sample_05.rb
  208. +195 −0 vendor/gems/rcov-0.8.1.2.0/test/test_CallSiteAnalyzer.rb
  209. +183 −0 vendor/gems/rcov-0.8.1.2.0/test/test_CodeCoverageAnalyzer.rb
  210. +473 −0 vendor/gems/rcov-0.8.1.2.0/test/test_FileStatistics.rb
  211. +105 −0 vendor/gems/rcov-0.8.1.2.0/test/test_functional.rb
  212. +4 −0 vendor/gems/rcov-0.8.1.2.0/test/turn_off_rcovrt.rb
  213. +1,028 −0 vendor/gems/xml-simple-1.0.12/lib/xmlsimple.rb
  214. +1 −0  vendor/plugins/redcloth_template/test/fixtures/erb.red
  215. +3 −0  vendor/plugins/redcloth_template/test/fixtures/textile.red
  216. +64 −0 vendor/rails/actionmailer/lib/action_mailer/test_case.rb
  217. +68 −0 vendor/rails/actionmailer/lib/action_mailer/test_helper.rb
  218. +1,466 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/text-format-0.6.3/text/format.rb
  219. +10 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/text_format.rb
  220. +5 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail.rb
  221. +426 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/address.rb
  222. +46 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/attachments.rb
  223. +46 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/base64.rb
  224. +41 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/compat.rb
  225. +67 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/config.rb
  226. +63 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/core_extensions.rb
  227. +581 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/encode.rb
  228. +960 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/header.rb
  229. +9 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/index.rb
  230. +1,130 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/interface.rb
  231. +3 −0  vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/loader.rb
  232. +578 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/mail.rb
  233. +495 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/mailbox.rb
  234. +6 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/main.rb
  235. +3 −0  vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/mbox.rb
  236. +248 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/net.rb
  237. +132 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/obsolete.rb
  238. +1,476 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/parser.rb
  239. +379 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/port.rb
  240. +118 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/quoting.rb
  241. +58 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/require_arch.rb
  242. +49 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/scanner.rb
  243. +261 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/scanner_r.rb
  244. +280 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/stringio.rb
  245. +337 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/utils.rb
  246. +39 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/version.rb
  247. +1 −0  vendor/rails/actionmailer/lib/actionmailer.rb
  248. +54 −0 vendor/rails/actionmailer/test/asset_host_test.rb
  249. +51 −0 vendor/rails/actionmailer/test/delivery_method_test.rb
  250. +1 −0  vendor/rails/actionmailer/test/fixtures/asset_host_mailer/email_with_asset.html.erb
  251. +1 −0  vendor/rails/actionmailer/test/fixtures/auto_layout_mailer/hello.html.erb
  252. +1 −0  vendor/rails/actionmailer/test/fixtures/auto_layout_mailer/multipart.text.html.erb
  253. +1 −0  vendor/rails/actionmailer/test/fixtures/auto_layout_mailer/multipart.text.plain.erb
  254. +1 −0  vendor/rails/actionmailer/test/fixtures/explicit_layout_mailer/logout.html.erb
  255. +1 −0  vendor/rails/actionmailer/test/fixtures/explicit_layout_mailer/signup.html.erb
  256. +1 −0  vendor/rails/actionmailer/test/fixtures/first_mailer/share.erb
  257. +1 −0  vendor/rails/actionmailer/test/fixtures/helper_mailer/use_example_helper.erb
  258. +1 −0  vendor/rails/actionmailer/test/fixtures/helper_mailer/use_helper.erb
  259. +1 −0  vendor/rails/actionmailer/test/fixtures/helper_mailer/use_helper_method.erb
  260. +5 −0 vendor/rails/actionmailer/test/fixtures/helper_mailer/use_mail_helper.erb
  261. +5 −0 vendor/rails/actionmailer/test/fixtures/helpers/example_helper.rb
  262. +1 −0  vendor/rails/actionmailer/test/fixtures/layouts/auto_layout_mailer.html.erb
  263. +1 −0  vendor/rails/actionmailer/test/fixtures/layouts/auto_layout_mailer.text.erb
  264. +1 −0  vendor/rails/actionmailer/test/fixtures/layouts/spam.html.erb
  265. +1 −0  ...ails/actionmailer/test/fixtures/path.with.dots/funky_path_mailer/multipart_with_template_path_with_dots.erb
  266. +104 −0 vendor/rails/actionmailer/test/fixtures/raw_email_with_invalid_characters_in_content_type
  267. +100 −0 vendor/rails/actionmailer/test/fixtures/raw_email_with_nested_attachment
  268. +1 −0  vendor/rails/actionmailer/test/fixtures/second_mailer/share.erb
  269. +3 −0  vendor/rails/actionmailer/test/fixtures/templates/signed_up.erb
  270. +1 −0  vendor/rails/actionmailer/test/fixtures/test_mailer/_subtemplate.text.plain.erb
  271. +2 −0  vendor/rails/actionmailer/test/fixtures/test_mailer/body_ivar.erb
  272. +6 −0 vendor/rails/actionmailer/test/fixtures/test_mailer/custom_templating_extension.text.html.haml
  273. +6 −0 vendor/rails/actionmailer/test/fixtures/test_mailer/custom_templating_extension.text.plain.haml
  274. +1 −0  vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.ignored.erb
  275. +10 −0 vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.html.erb
  276. +2 −0  vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.plain.erb
  277. +1 −0  vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.yaml.erb
  278. +1 −0  vendor/rails/actionmailer/test/fixtures/test_mailer/included_subtemplate.text.plain.erb
  279. +2 −0  vendor/rails/actionmailer/test/fixtures/test_mailer/rxml_template.builder
  280. +2 −0  vendor/rails/actionmailer/test/fixtures/test_mailer/rxml_template.rxml
  281. +3 −0  vendor/rails/actionmailer/test/fixtures/test_mailer/signed_up.html.erb
  282. +5 −0 vendor/rails/actionmailer/test/fixtures/test_mailer/signed_up_with_url.erb
  283. +123 −0 vendor/rails/actionmailer/test/mail_layout_test.rb
  284. +129 −0 vendor/rails/actionmailer/test/test_helper_test.rb
  285. +169 −0 vendor/rails/actionpack/lib/action_controller/caching/actions.rb
  286. +120 −0 vendor/rails/actionpack/lib/action_controller/caching/fragments.rb
  287. +152 −0 vendor/rails/actionpack/lib/action_controller/caching/pages.rb
  288. +97 −0 vendor/rails/actionpack/lib/action_controller/caching/sweeping.rb
  289. +15 −0 vendor/rails/actionpack/lib/action_controller/cgi_ext.rb
  290. +112 −0 vendor/rails/actionpack/lib/action_controller/cgi_ext/cookie.rb
  291. +22 −0 vendor/rails/actionpack/lib/action_controller/cgi_ext/query_extension.rb
  292. +24 −0 vendor/rails/actionpack/lib/action_controller/cgi_ext/stdinput.rb
  293. +118 −0 vendor/rails/actionpack/lib/action_controller/dispatcher.rb
  294. +52 −0 vendor/rails/actionpack/lib/action_controller/failsafe.rb
  295. +33 −0 vendor/rails/actionpack/lib/action_controller/headers.rb
  296. +304 −0 vendor/rails/actionpack/lib/action_controller/http_authentication.rb
  297. +119 −0 vendor/rails/actionpack/lib/action_controller/middleware_stack.rb
  298. +13 −0 vendor/rails/actionpack/lib/action_controller/middlewares.rb
  299. +21 −0 vendor/rails/actionpack/lib/action_controller/mime_types.rb
  300. +71 −0 vendor/rails/actionpack/lib/action_controller/params_parser.rb
Sorry, we could not display the entire diff because too many files (1,174) changed.
View
14 app/controllers/application_controller.rb
@@ -0,0 +1,14 @@
+# Filters added to this controller apply to all controllers in the application.
+# Likewise, all the methods added will be available for all controllers.
+
+class ApplicationController < ActionController::Base
+ helper :all # include all helpers, all the time
+ protect_from_forgery # See ActionController::RequestForgeryProtection for details
+
+ def render_not_found
+ render :file => File.join(RAILS_ROOT, 'public/404.html'), :status => 404
+ end
+
+ # Scrub sensitive parameters from your log
+ # filter_parameter_logging :password
+end
View
22 config/database.yml
@@ -0,0 +1,22 @@
+# SQLite version 3.x
+# gem install sqlite3-ruby (not necessary on OS X Leopard)
+development:
+ adapter: sqlite3
+ database: db/development.sqlite3
+ pool: 5
+ timeout: 5000
+
+# Warning: The database defined as "test" will be erased and
+# re-generated from your development database when you run "rake".
+# Do not set this db to the same as development or production.
+test:
+ adapter: sqlite3
+ database: db/test.sqlite3
+ pool: 5
+ timeout: 5000
+
+production:
+ adapter: sqlite3
+ database: db/production.sqlite3
+ pool: 5
+ timeout: 5000
View
7 config/initializers/backtrace_silencers.rb
@@ -0,0 +1,7 @@
+# Be sure to restart your server when you modify this file.
+
+# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
+# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
+
+# You can also remove all the silencers if you're trying do debug a problem that might steem from framework code.
+# Rails.backtrace_cleaner.remove_silencers!
View
10 config/initializers/inflections.rb
@@ -0,0 +1,10 @@
+# Be sure to restart your server when you modify this file.
+
+# Add new inflection rules using the following format
+# (all these examples are active by default):
+# ActiveSupport::Inflector.inflections do |inflect|
+# inflect.plural /^(ox)$/i, '\1en'
+# inflect.singular /^(ox)en/i, '\1'
+# inflect.irregular 'person', 'people'
+# inflect.uncountable %w( fish sheep )
+# end
View
5 config/initializers/mime_types.rb
@@ -0,0 +1,5 @@
+# Be sure to restart your server when you modify this file.
+
+# Add new mime types for use in respond_to blocks:
+# Mime::Type.register "text/richtext", :rtf
+# Mime::Type.register_alias "text/html", :iphone
View
19 config/initializers/new_rails_defaults.rb
@@ -0,0 +1,19 @@
+# Be sure to restart your server when you modify this file.
+
+# These settings change the behavior of Rails 2 apps and will be defaults
+# for Rails 3. You can remove this initializer when Rails 3 is released.
+
+if defined?(ActiveRecord)
+ # Include Active Record class name as root for JSON serialized output.
+ # config.active_record.include_root_in_json = true
+
+ # Store the full class name (including module namespace) in STI type column.
+ # ActiveRecord::Base.store_full_sti_class = true
+end
+
+# Use ISO 8601 format for JSON serialized times and dates.
+ActiveSupport.use_standard_json_time_format = true
+
+# Don't escape HTML entities in JSON, leave that for the #json_escape helper.
+# if you're including raw json in an HTML page.
+ActiveSupport.escape_html_entities_in_json = false
View
15 config/initializers/session_store.rb
@@ -0,0 +1,15 @@
+# Be sure to restart your server when you modify this file.
+
+# Your secret key for verifying cookie session data integrity.
+# If you change this key, all old sessions will become invalid!
+# Make sure the secret is at least 30 characters and all random,
+# no regular words or you'll be exposed to dictionary attacks.
+ActionController::Base.session = {
+ :key => '_cruisecontrol.rb_session',
+ :secret => 'bbea68db1dca5217885b02cfaa80b7d86df9898871e15ccbefc2c26c8c48990007dda2598376b73eac37dd9b8190b550d2a1c62479cbae7483f19b4ffdb3f584'
+}
+
+# Use the database for sessions instead of the cookie-based default,
+# which shouldn't be used to store highly confidential information
+# (create the session table with "rake db:sessions:create")
+# ActionController::Base.session_store = :active_record_store
View
5 config/locales/en.yml
@@ -0,0 +1,5 @@
+# Sample localization file for English. Add more files in this directory for other locales.
+# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
+
+en:
+ hello: "Hello world"
View
2  doc/README_FOR_APP
@@ -0,0 +1,2 @@
+Use this README file to introduce your application and point to useful places in the API for learning more.
+Run "rake doc:app" to generate API documentation for your models, controllers, helpers, and libraries.
View
30 public/422.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
+ <title>The change you wanted was rejected (422)</title>
+ <style type="text/css">
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
+ div.dialog {
+ width: 25em;
+ padding: 0 4em;
+ margin: 4em auto 0 auto;
+ border: 1px solid #ccc;
+ border-right-color: #999;
+ border-bottom-color: #999;
+ }
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
+ </style>
+</head>
+
+<body>
+ <!-- This file lives in public/422.html -->
+ <div class="dialog">
+ <h1>The change you wanted was rejected.</h1>
+ <p>Maybe you tried to change something you didn't have access to.</p>
+ </div>
+</body>
+</html>
View
3  script/dbconsole
@@ -0,0 +1,3 @@
+#!/usr/bin/env ruby
+require File.dirname(__FILE__) + '/../config/boot'
+require 'commands/dbconsole'
View
9 test/performance/browsing_test.rb
@@ -0,0 +1,9 @@
+require 'test_helper'
+require 'performance_test_help'
+
+# Profiling results for each test method are written to tmp/performance.
+class BrowsingTest < ActionController::PerformanceTest
+ def test_homepage
+ get '/'
+ end
+end
View
3  vendor/gems/mocha-0.9.5/COPYING
@@ -0,0 +1,3 @@
+Copyright Revieworld Ltd. 2006
+
+You may use, copy and redistribute this library under the same terms as Ruby itself (see http://www.ruby-lang.org/en/LICENSE.txt) or under the MIT license (see MIT-LICENSE file).
View
7 vendor/gems/mocha-0.9.5/MIT-LICENSE
@@ -0,0 +1,7 @@
+Copyright (c) 2006 Revieworld Ltd.
+
+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/gems/mocha-0.9.5/README
@@ -0,0 +1,37 @@
+= Mocha
+
+Mocha is a library for mocking and stubbing using a syntax like that of JMock[http://www.jmock.org].
+
+It can be used with many testing frameworks e.g. Test::Unit[http://www.ruby-doc.org/core/classes/Test/Unit.html], RSpec[http://rspec.info/], test/spec[http://chneukirchen.org/repos/testspec/README], expectations[http://expectations.rubyforge.org/], Dust[http://dust.rubyforge.org/], MiniTest[http://rubyforge.org/projects/bfts] and even JtestR[http://jtestr.codehaus.org/].
+
+Mocha provides a unified, simple and readable syntax for both traditional mocking and partial mocking.
+
+Mocha was harvested from projects at Reevoo[http://www.reevoo.com] by me (James[http://blog.floehopper.org]) and my (then) colleagues Ben[http://www.techbelly.com/], Chris[http://chrisroos.co.uk] and Paul[http://po-ru.com].
+
+== Download and Installation
+
+Install the gem with the following command...
+
+ $ gem install mocha
+
+Or install the Rails[http://www.rubyonrails.org] plugin...
+
+ $ script/plugin install git://github.com/floehopper/mocha.git
+
+Or download Mocha...
+
+ http://rubyforge.org/frs/?group_id=1917
+
+== Examples
+
+* Quick Start - {Usage Examples}[link:examples/misc.html]
+* Traditional mocking - {Star Trek Example}[link:examples/mocha.html]
+* Setting expectations on real classes - {Order Example}[link:examples/stubba.html]
+* More examples on {Floehopper's Blog}[http://blog.floehopper.org]
+* {Mailing List Archives}[http://groups.google.com/group/mocha-developer]
+
+== License
+
+Copyright Revieworld Ltd. 2006
+
+You may use, copy and redistribute this library under the same terms as {Ruby itself}[http://www.ruby-lang.org/en/LICENSE.txt] or under the {MIT license}[http://mocha.rubyforge.org/files/MIT-LICENSE.html].
View
269 vendor/gems/mocha-0.9.5/RELEASE
@@ -0,0 +1,269 @@
+= 0.9.5 (93cad010345ce5d68f31422cfc32ed9dd6de13ec)
+* Fixed Lighthouse bug #32 - stub_everything should mean mock responds to anything.
+* Added Expectation#twice to improve readability. Tthanks to pull request from Celestino Gomes.
+* In Ruby 1.9, requiring 'test/unit' loads a thin wrapper around MiniTest and Test::Unit::TestCase ends up inheriting from MiniTest::Unit::TestCase. So we need to avoid including the Mocha modules more than once to avoid nasty consequences. Thanks to Matthias Hennemeyer for help with this.
+* Ruby 1.9 includes rake, but not rake/contrib. For the moment I've moved the sshpublisher require into the only rake task that needs it, so that I can at least run the tests in Ruby 1.9. It looks like I will need to build a rake/contrib gem or similar to get this working properly - http://intertwingly.net/blog/2008/01/07/Rake-Contrib-for-1-9
+
+= 0.9.4 (8a59c6ff0f99f34b02bd99f19536a7893be2b340)
+* Added mocha.gemspec file generated with Chad Woolley's new rake task, so that a floehopper-mocha gem will get built on GitHub.
+* Add rake task to update mocha.gemspec with unique version, which will cause gem to be auto-built on github
+* As Tobias Crawley correctly pointed out in feature request #23055 "stubs(with_hash) not working with existing object" [1], following the principle of least surprise, it should be possible to call ObjectMethods#expects & ObjectMethods#stubs with a Hash of method_names vs return_values like you can with Mock#expects & Mock#stubs. I've also updated & improved the docs to reflect the changes. [1] http://rubyforge.org/tracker/index.php?func=detail&aid=23055&group_id=1917&atid=7480
+* Removed deprecated gem autorequire.
+
+= 0.9.3 (8219bb2d2881c8529c93fc21e97a11d01203c759)
+* Added support for MiniTest thanks to Jeff Smick.
+* Fixed a possible bug with some of the non-default Configuration options relating to the argument to Object#respond_to?
+* As per Jay Fields recommendations [1] and with further impetus from a talk at Ruby Manor, any methods added to core classes are now added by including a module. This means that Mocha is a better citizen of the Ruby world and it's behaviour is more easily extended. [1] http://blog.jayfields.com/2008/07/ruby-underuse-of-modules.html & http://blog.jayfields.com/2008/07/ruby-redefine-method-behavior.html
+* Removed deprecated gem autorequire.
+
+= 0.9.2 (r355)
+* Improved documentation to address [#22530] 'Mock methods with multiple return values not possible?'
+* respond_with parameter matcher was not available in tests.
+* Patch [#22630] Fix for a bug in running Rails tests with Ruby 1.8.7. Array#flatten was being called which in turn was checking whether each element responded to #to_ary. This check was using the two parameter version of #respond_to?, but Mock was only defining a one parameter version.
+
+= 0.9.1 (r349)
+
+* Fixed bug #21465 - expects & stubs should support method names as strings (as well as symbols) or fail fast. Convert all expectation method names to a symbol in case they were supplied as a string.
+* By removing Mock#unexpected_method_called we reduce the number of methods vulnerable to the problem that surfaced in bug #21563.
+* Fix bug #21563 - stubbing 'verified?' method is unsafe. Instance method names on the Mock class should be more obscure.
+* Performance improvement. StubbaExampleTest goes twice as fast on my local machine.
+* Added primitive performance test to default rake task.
+* Fix format of case statements which don't work in Ruby 1.9 and make others consistent.
+* There is no point in running (potentially expensive) checks if configuration is set to allow such checks to fail. This is a relatively quick fix in response to Chris McGrath's performance problems.
+* Fix for bug #21161 - 'uninitialized constant Deprecation in stubba.rb'.
+* It's more readable to talk about 'once' and 'twice' rather than '1 time' and '2 times'.
+* Fix bug #20883 - never should raise when called to prevent follow up errors. Fail fast when there are no matching invokable expectations and handle the stub_everything case sensibly. This might not be entirely backwards compatible, but I think the benefits outweigh the risks. The most likely change is that a test that was already failing will now fail faster, which doesn't seem so awful.
+
+= 0.9.0 (r316)
+
+* Configurable warnings or errors
+ * when a method on a non-public method is stubbed
+ * when a method on a non-existent method is stubbed
+ * when a method on a non-mock object is stubbed
+ * when a method is stubbed unnecessarily (i.e. the stubbed method is not called during the test)
+
+* Improved error messages
+ * User-friendly list of unsatisfied expectations, satisfied expectations and state machines.
+ * Improved readability of cardinality description.
+ * Display sensible failure message for any_instance expectations e.g. "#<AnyInstance:Foo>.bar - expected calls: 1, actual calls: 0"
+
+* Parameter matchers
+ * New to this release
+ * optionally (allows matching of optional parameters if available)
+ * yaml_equivalent (allows matching of YAML that represents the specified object)
+ * responds_with (tests the quack not the duck)
+ * Nesting of parameter matchers is now supported.
+
+* Optional block passed into mock initializer is evaluated in the context of the new mock instance and can be used as a shortcut to set up expectations.
+
+* Added JMock-style sequences for constraining the order of expected invocations. See Standalone#sequence and Expectation#in_sequence.
+
+* Added JMock-style states for constraining the order of expected invocations. See Standalone#states, Expectation#then, Expectation#when and StateMachine.
+
+* Compatibility with versions of Ruby
+ * Compatibility with Ruby v1.9. All test errors and warnings fixed.
+ * Nasty fix so that TestCaseAdaptor works consistently with earlier versions of Test::Unit as well as more recent versions.
+ * Added platform to gem specification to avoid bug in rubygems 0.9.5 - see http://www.dcmanges.com/blog/rubygems-0-9-5-platform-bug and http://rubygems.org/read/chapter/20#platform.
+ * Make ExpectationRaiser deal with subclasses of Interrupt which seem to need a message supplied in the raise statement in Ruby 1.8.6 (but not 1.8.4 or 1.9). Not sure this is really Mocha's responsibility.
+
+* Added deprecation warning in stubba.rb which is no longer needed and will be removed.
+
+* Supply positioning information to evals to improve any error messages. See http://ola-bini.blogspot.com/2008/01/ruby-antipattern-using-eval-without.html
+
+* Bug fixes
+ * 18914 in revision 296 - http://rubyforge.org/tracker/index.php?func=detail&aid=18914&group_id=1917&atid=7477
+ * 18917 in revision 295 - http://rubyforge.org/tracker/index.php?func=detail&aid=18917&group_id=1917&atid=7477
+ * 18336 in revision 287 - http://rubyforge.org/tracker/index.php?func=detail&aid=18336&group_id=1917&atid=7477
+ * 17835 in revision 255 - http://rubyforge.org/tracker/index.php?func=detail&aid=17835&group_id=1917&atid=7477
+ * 17412 in revision 242 - http://rubyforge.org/tracker/index.php?func=detail&aid=17412&group_id=1917&atid=7477
+ * 15977 in revision 198 - http://rubyforge.org/tracker/index.php?func=detail&aid=15977&group_id=1917&atid=7477
+ * 11885 in revision 156 - http://rubyforge.org/tracker/index.php?func=detail&aid=11885&group_id=1917&atid=7477
+
+= 0.5.5 (r167)
+
+- Renamed Matches parameter matcher to RegexpMatches for clarity.
+- Added noframes tag to rdoc index to assist Google.
+
+= 0.5.4 (r166)
+
+- Added matches parameter matcher for matching regular expressions.
+
+= 0.5.3 (r165)
+
+- Attempt to fix packaging problems by switching to newer version (1.15.1) of gnutar and setting COPY_EXTENDED_ATTRIBUTES_DISABLE environment variable.
+- Removed unused ExpectationSequenceError exception.
+- Added instance_of and kind_of parameter matchers.
+- Added Google Webmaster meta tag to rdoc template header.
+- Put Google Webmaster meta tag in the right header i.e. the one for the index page.
+
+= 0.5.2 (r159)
+
+- Fix bug 11885 - "never doesn't work with stub_everything" submitted by Alexander Lang. In fixing this bug, also fixed undiscoverd bug where expected & actual invocation counts were being incorrectly reported which seems to have been introduced when fixes were added for invocation dispatch (see MockedMethodDispatchAcceptanceTest).
+- Previously when an expectation did not allow more invocations, it was treated as not matching. Now we prefer matching expectations which allow more invocations, but still match expectations which cannot allow more invocations. I think this may be overcomplicating things, but let's see how it goes.
+
+= 0.5.1 (r149)
+
+- Fixed bug #11583 "Mocha 0.5.0 throwing unexpected warnings". Also switched on ruby warning for all rake test tasks. Fixed majority of warnings, but some left to fix.
+
+= 0.5.0 (r147)
+
+- Parameter Matchers - I’ve added a few Hamcrest-style parameter matchers which are designed to be used inside Expectation#with. The following matchers are currently available: anything(), includes(), has_key(), has_value(), has_entry(), all_of() & any_of(). More to follow soon. The idea is eventually to get rid of the nasty parameter_block option on Expectation#with.
+
+ object = mock()
+ object.expects(:method).with(has_key('key_1'))
+ object.method('key_1' => 1, 'key_2' => 2)
+ # no verification error raised
+
+ object = mock()
+ object.expects(:method).with(has_key('key_1'))
+ object.method('key_2' => 2)
+ # verification error raised, because method was not called with Hash containing key: 'key_1'
+
+- Values Returned and Exceptions Raised on Consecutive Invocations - Allow multiple calls to Expectation#returns and Expectation#raises to build up a sequence of responses to invocations on the mock. Added syntactic sugar method Expectation#then to allow more readable expectations.
+
+ object = mock()
+ object.stubs(:method).returns(1, 2).then.raises(Exception).then.returns(4)
+ object.method # => 1
+ object.method # => 2
+ object.method # => raises exception of class Exception
+ object.method # => 4
+
+- Yields on Consecutive Invocations - Allow multiple calls to yields on single expectation to allow yield parameters to be specified for consecutive invocations.
+
+ object = mock()
+ object.stubs(:method).yields(1, 2).then.yields(3)
+ object.method { |*values| p values } # => [1, 2]
+ object.method { |*values| p values } # => [3]
+
+- Multiple Yields on Single Invocation - Added Expectation#multiple_yields to allow a mocked or stubbed method to yield multiple times for a single invocation.
+
+ object = mock()
+ object.stubs(:method).multiple_yields([1, 2], [3])
+ object.method { |*values| p values } # => [1, 2] # => [3]
+
+- Invocation Dispatch - Expectations were already being matched in reverse order i.e. the most recently defined one was being found first. This is still the case, but we now stop matching an expectation when its maximum number of expected invocations is reached. c.f. JMock v1. A stub will never stop matching by default. Hopefully this means we can soon get rid of the need to pass a Proc to Expectation#returns.
+
+ object = mock()
+ object.stubs(:method).returns(2)
+ object.expects(:method).once.returns(1)
+ object.method # => 1
+ object.method # => 2
+ object.method # => 2
+ # no verification error raised
+
+ # The following should still work...
+
+ Time.stubs(:now).returns(Time.parse('Mon Jan 01 00:00:00 UTC 2007'))
+ Time.now # => Mon Jan 01 00:00:00 UTC 2007
+ Time.stubs(:now).returns(Time.parse('Thu Feb 01 00:00:00 UTC 2007'))
+ Time.now # => Thu Feb 01 00:00:00 UTC 2007
+
+- Deprecate passing an instance of Proc to Expectation#returns.
+- Explicitly include all Rakefile dependencies in project.
+- Fixed old Stubba example.
+- Fix so that it is possible for a stubbed method to raise an Interrupt exception without a message in Ruby 1.8.6
+- Added responds_like and quacks_like.
+- Capture standard object methods before Mocha adds any.
+- Added Expectation#once method to make interface less surprising.
+- Use Rake::TestTask to run tests. Created three separate tasks to run unit, integration & acceptance tests. Split inspect_test into one file per TestCase. Deleted superfluous all_tests file.
+- Fiddled with mocha_inspect and tests to give more sensible results on x86 platform.
+- Fixed bug #7834 "infinite_range.rb makes incorrect assumption about to_f" logged by James Moore.
+
+= 0.4.0 (r92)
+
+- Allow naming of mocks (patch from Chris Roos).
+- Specify multiple return values for consecutive calls.
+- Improved consistency of expectation error messages.
+- Allow mocking of Object instance methods e.g. kind_of?, type.
+- Provide aliased versions of #expects and #stubs to allow mocking of these methods.
+- Added at_least, at_most, at_most_once methods to expectation.
+- Allow expects and stubs to take a hash of method and return values.
+- Eliminate warning: "instance variable @yield not initialized" (patch from Xavier Shay).
+- Restore instance methods on partial mocks (patch from Chris Roos).
+- Allow stubbing of a method with non-word characters in its name (patch from Paul Battley).
+- Removed coupling to Test::Unit.
+- Allow specified exception instance to be raised (patch from Chris Roos).
+- Make mock object_id appear in hex like normal Ruby inspect (patch from Paul Battley).
+- Fix path to object.rb in rdoc rake task (patch from Tomas Pospisek).
+- Reverse order in which expectations are matched, so that last expectation is matched first. This allows e.g. a call to #stubs to be effectively overridden by a call to #expects (patch from Tobias Lutke).
+- Stubba & SmartTestCase modules incorporated into Mocha module so only need to require 'mocha' - no longer need to require 'stubba'.
+- AutoMocha removed.
+
+= 0.3.3
+
+- Quick bug fix to restore instance methods on partial mocks (for Kevin Clark).
+
+= 0.3.2
+
+- Examples added.
+
+= 0.3.1
+
+- Dual licensing with MIT license added.
+
+= 0.3.0
+
+* Rails plugin.
+* Auto-verify for expectations on concrete classes.
+* Include each expectation verification in the test result assertion count.
+* Filter out noise from assertion backtraces.
+* Point assertion backtrace to line where failing expectation was created.
+* New yields method for expectations.
+* Create stubs which stub all method calls.
+* Mocks now respond_to? expected methods.
+
+= 0.2.1
+
+* Rename MochaAcceptanceTest::Rover#move method to avoid conflict with Rake (in Ruby 1.8.4 only?)
+
+= 0.2.0
+
+* Small change to SetupAndTeardown#teardown_stubs suggested by Luke Redpath (http://www.lukeredpath.co.uk) to allow use of Stubba with RSpec (http://rspec.rubyforge.org).
+* Reorganized directory structure and extracted addition of setup and teardown methods into SmartTestCase mini-library.
+* Addition of auto-verify for Mocha (but not Stubba). This means there is more significance in the choice of expects or stubs in that any expects on a mock will automatically get verified.
+
+So instead of...
+
+ wotsit = Mocha.new
+ wotsit.expects(:thingummy).with(5).returns(10)
+ doobrey = Doobrey.new(wotsit)
+ doobrey.hoojamaflip
+ wotsit.verify
+
+you need to do...
+
+ wotsit = mock()
+ wotsit.expects(:thingummy).with(5).returns(10)
+ doobrey = Doobrey.new(wotsit)
+ doobrey.hoojamaflip
+ # no need to verify
+
+There are also shortcuts as follows...
+
+instead of...
+
+ wotsit = Mocha.new
+ wotsit.expects(:thingummy).returns(10)
+ wotsit.expects(:summat).returns(25)
+
+you can have...
+
+ wotsit = mock(:thingummy => 5, :summat => 25)
+
+and instead of...
+
+ wotsit = Mocha.new
+ wotsit.stubs(:thingummy).returns(10)
+ wotsit.stubs(:summat).returns(25)
+
+you can have...
+
+ wotsit = stub(:thingummy => 5, :summat => 25)
+
+= 0.1.2
+
+* Minor tweaks
+
+= 0.1.1
+
+* Initial release.
View
207 vendor/gems/mocha-0.9.5/Rakefile
@@ -0,0 +1,207 @@
+require 'rubygems'
+require 'rake/rdoctask'
+require 'rake/gempackagetask'
+require 'rake/testtask'
+
+module Mocha
+ VERSION = "0.9.5"
+end
+
+desc "Run all tests"
+task 'default' => ['test:units', 'test:acceptance', 'test:performance']
+
+namespace 'test' do
+
+ unit_tests = FileList['test/unit/**/*_test.rb']
+ acceptance_tests = FileList['test/acceptance/*_test.rb']
+
+ desc "Run unit tests"
+ Rake::TestTask.new('units') do |t|
+ t.libs << 'test'
+ t.test_files = unit_tests
+ t.verbose = true
+ t.warning = true
+ end
+
+ desc "Run acceptance tests"
+ Rake::TestTask.new('acceptance') do |t|
+ t.libs << 'test'
+ t.test_files = acceptance_tests
+ t.verbose = true
+ t.warning = true
+ end
+
+ # require 'rcov/rcovtask'
+ # Rcov::RcovTask.new('coverage') do |t|
+ # t.libs << 'test'
+ # t.test_files = unit_tests + acceptance_tests
+ # t.verbose = true
+ # t.warning = true
+ # t.rcov_opts << '--sort coverage'
+ # t.rcov_opts << '--xref'
+ # end
+
+ desc "Run performance tests"
+ task 'performance' do
+ require 'test/acceptance/stubba_example_test'
+ require 'test/acceptance/mocha_example_test'
+ iterations = 1000
+ puts "\nBenchmarking with #{iterations} iterations..."
+ [MochaExampleTest, StubbaExampleTest].each do |test_case|
+ puts "#{test_case}: #{benchmark_test_case(test_case, iterations)} seconds."
+ end
+ end
+
+end
+
+def benchmark_test_case(klass, iterations)
+ require 'test/unit/ui/console/testrunner'
+ require 'benchmark'
+ time = Benchmark.realtime { iterations.times { Test::Unit::UI::Console::TestRunner.run(klass, Test::Unit::UI::SILENT) } }
+end
+
+desc 'Generate RDoc'
+Rake::RDocTask.new('rdoc') do |task|
+ task.main = 'README'
+ task.title = "Mocha #{Mocha::VERSION}"
+ task.rdoc_dir = 'doc'
+ task.template = File.expand_path(File.join(File.dirname(__FILE__), "templates", "html_with_google_analytics"))
+ task.rdoc_files.include(
+ 'README',
+ 'RELEASE',
+ 'COPYING',
+ 'MIT-LICENSE',
+ 'agiledox.txt',
+ 'lib/mocha/standalone.rb',
+ 'lib/mocha/mock.rb',
+ 'lib/mocha/expectation.rb',
+ 'lib/mocha/object.rb',
+ 'lib/mocha/parameter_matchers.rb',
+ 'lib/mocha/parameter_matchers',
+ 'lib/mocha/state_machine.rb',
+ 'lib/mocha/configuration.rb',
+ 'lib/mocha/stubbing_error.rb'
+ )
+end
+
+desc "Generate all documentation"
+task 'generate_docs' => ['clobber_rdoc', 'rdoc', 'examples', 'agiledox.txt']
+
+desc "Upload RDoc to RubyForge"
+task 'publish_docs' do
+ require 'rake/contrib/sshpublisher'
+ Rake::SshDirPublisher.new("jamesmead@rubyforge.org", "/var/www/gforge-projects/mocha", "doc").upload
+end
+
+desc "Generate agiledox-like documentation for tests"
+file 'agiledox.txt' do
+ File.open('agiledox.txt', 'w') do |output|
+ tests = FileList['test/**/*_test.rb']
+ tests.each do |file|
+ m = %r".*/([^/].*)_test.rb".match(file)
+ output << m[1]+" should:\n"
+ test_definitions = File::readlines(file).select {|line| line =~ /.*def test.*/}
+ test_definitions.sort.each do |definition|
+ m = %r"test_(should_)?(.*)".match(definition)
+ output << " - "+m[2].gsub(/_/," ") << "\n"
+ end
+ end
+ end
+end
+
+desc "Convert example ruby files to syntax-highlighted html"
+task 'examples' do
+ $:.unshift File.expand_path(File.join(File.dirname(__FILE__), "vendor", "coderay-0.7.4.215", "lib"))
+ require 'coderay'
+ mkdir_p 'doc/examples'
+ File.open('doc/examples/coderay.css', 'w') do |output|
+ output << CodeRay::Encoders[:html]::CSS.new.stylesheet
+ end
+ ['mocha', 'stubba', 'misc'].each do |filename|
+ File.open("doc/examples/#{filename}.html", 'w') do |file|
+ file << "<html>"
+ file << "<head>"
+ file << %q(<link rel="stylesheet" media="screen" href="coderay.css" type="text/css">)
+ file << "</head>"
+ file << "<body>"
+ file << CodeRay.scan_file("examples/#{filename}.rb").html.div
+ file << "</body>"
+ file << "</html>"
+ end
+ end
+end
+
+Gem.manage_gems if Gem::RubyGemsVersion < '1.2.0'
+
+def build_specification(version = Mocha::VERSION)
+ Gem::Specification.new do |s|
+ s.name = "mocha"
+ s.summary = "Mocking and stubbing library"
+ s.version = version
+ s.platform = Gem::Platform::RUBY
+ s.author = 'James Mead'
+ s.description = <<-EOF
+ Mocking and stubbing library with JMock/SchMock syntax, which allows mocking and stubbing of methods on real (non-mock) classes.
+ EOF
+ s.email = 'mocha-developer@googlegroups.com'
+ s.homepage = 'http://mocha.rubyforge.org'
+ s.rubyforge_project = 'mocha'
+
+ s.has_rdoc = true
+ s.extra_rdoc_files = ['README', 'COPYING']
+ s.rdoc_options << '--title' << 'Mocha' << '--main' << 'README' << '--line-numbers'
+
+ s.add_dependency('rake')
+ s.files = FileList['{lib,test,examples}/**/*.rb', '[A-Z]*'].exclude('TODO').to_a
+ end
+end
+
+specification = build_specification
+
+Rake::GemPackageTask.new(specification) do |package|
+ package.need_zip = true
+ package.need_tar = true
+end
+
+desc 'Generate updated gemspec with unique version, which will cause gem to be auto-built on github.'
+task :update_gemspec do
+ File.open('mocha.gemspec', 'w') do |output|
+ output << build_specification(Mocha::VERSION + '.' + Time.now.strftime('%Y%m%d%H%M%S')).to_ruby
+ end
+end
+
+task 'verify_user' do
+ raise "RUBYFORGE_USER environment variable not set!" unless ENV['RUBYFORGE_USER']
+end
+
+task 'verify_password' do
+ raise "RUBYFORGE_PASSWORD environment variable not set!" unless ENV['RUBYFORGE_PASSWORD']
+end
+
+desc "Publish package files on RubyForge."
+task 'publish_packages' => ['verify_user', 'verify_password', 'clobber_package', 'package'] do
+ $:.unshift File.expand_path(File.join(File.dirname(__FILE__), "vendor", "meta_project-0.4.15", "lib"))
+ require 'meta_project'
+ require 'rake/contrib/xforge'
+ release_files = FileList[
+ "pkg/mocha-#{Mocha::VERSION}.gem",
+ "pkg/mocha-#{Mocha::VERSION}.tgz",
+ "pkg/mocha-#{Mocha::VERSION}.zip"
+ ]
+
+ Rake::XForge::Release.new(MetaProject::Project::XForge::RubyForge.new('mocha')) do |release|
+ release.user_name = ENV['RUBYFORGE_USER']
+ release.password = ENV['RUBYFORGE_PASSWORD']
+ release.files = release_files.to_a
+ release.release_name = "Mocha #{Mocha::VERSION}"
+ release.release_changes = ''
+ release.release_notes = ''
+ end
+end
+
+desc "Do a full release."
+task 'release' => ['default', 'generate_docs', 'publish_packages', 'publish_docs', 'update_gemspec'] do
+ puts
+ puts "*** Remember to commit newly generated gemspec after release ***"
+ puts
+end
View
44 vendor/gems/mocha-0.9.5/examples/misc.rb
@@ -0,0 +1,44 @@
+require 'test/unit'
+require 'rubygems'
+require 'mocha'
+
+class MiscExampleTest < Test::Unit::TestCase
+
+ def test_mocking_a_class_method
+ product = Product.new
+ Product.expects(:find).with(1).returns(product)
+ assert_equal product, Product.find(1)
+ end
+
+ def test_mocking_an_instance_method_on_a_real_object
+ product = Product.new
+ product.expects(:save).returns(true)
+ assert product.save
+ end
+
+ def test_stubbing_instance_methods_on_real_objects
+ prices = [stub(:pence => 1000), stub(:pence => 2000)]
+ product = Product.new
+ product.stubs(:prices).returns(prices)
+ assert_equal [1000, 2000], product.prices.collect {|p| p.pence}
+ end
+
+ def test_stubbing_an_instance_method_on_all_instances_of_a_class
+ Product.any_instance.stubs(:name).returns('stubbed_name')
+ product = Product.new
+ assert_equal 'stubbed_name', product.name
+ end
+
+ def test_traditional_mocking
+ object = mock()
+ object.expects(:expected_method).with(:p1, :p2).returns(:result)
+ assert_equal :result, object.expected_method(:p1, :p2)
+ end
+
+ def test_shortcuts
+ object = stub(:method1 => :result1, :method2 => :result2)
+ assert_equal :result1, object.method1
+ assert_equal :result2, object.method2
+ end
+
+end
View
26 vendor/gems/mocha-0.9.5/examples/mocha.rb
@@ -0,0 +1,26 @@
+class Enterprise
+
+ def initialize(dilithium)
+ @dilithium = dilithium
+ end
+
+ def go(warp_factor)
+ warp_factor.times { @dilithium.nuke(:anti_matter) }
+ end
+
+end
+
+require 'test/unit'
+require 'rubygems'
+require 'mocha'
+
+class EnterpriseTest < Test::Unit::TestCase
+
+ def test_should_boldly_go
+ dilithium = mock()
+ dilithium.expects(:nuke).with(:anti_matter).at_least_once # auto-verified at end of test
+ enterprise = Enterprise.new(dilithium)
+ enterprise.go(2)
+ end
+
+end
View
65 vendor/gems/mocha-0.9.5/examples/stubba.rb
@@ -0,0 +1,65 @@
+class Order
+
+ attr_accessor :shipped_on
+
+ def total_cost
+ line_items.inject(0) { |total, line_item| total + line_item.price } + shipping_cost
+ end
+
+ def total_weight
+ line_items.inject(0) { |total, line_item| total + line_item.weight }
+ end
+
+ def shipping_cost
+ total_weight * 5 + 10
+ end
+
+ class << self
+
+ def find_all
+ # Database.connection.execute('select * from orders...
+ end
+
+ def number_shipped_since(date)
+ find_all.select { |order| order.shipped_on > date }.length
+ end
+
+ def unshipped_value
+ find_all.inject(0) { |total, order| order.shipped_on ? total : total + order.total_cost }
+ end
+
+ end
+
+end
+
+require 'test/unit'
+require 'rubygems'
+require 'mocha'
+
+class OrderTest < Test::Unit::TestCase
+
+ # illustrates stubbing instance method
+ def test_should_calculate_shipping_cost_based_on_total_weight
+ order = Order.new
+ order.stubs(:total_weight).returns(10)
+ assert_equal 60, order.shipping_cost
+ end
+
+ # illustrates stubbing class method
+ def test_should_count_number_of_orders_shipped_after_specified_date
+ now = Time.now; week_in_secs = 7 * 24 * 60 * 60
+ order_1 = Order.new; order_1.shipped_on = now - 1 * week_in_secs
+ order_2 = Order.new; order_2.shipped_on = now - 3 * week_in_secs
+ Order.stubs(:find_all).returns([order_1, order_2])
+ assert_equal 1, Order.number_shipped_since(now - 2 * week_in_secs)
+ end
+
+ # illustrates stubbing instance method for all instances of a class
+ def test_should_calculate_value_of_unshipped_orders
+ Order.stubs(:find_all).returns([Order.new, Order.new, Order.new])
+ Order.any_instance.stubs(:shipped_on).returns(nil)
+ Order.any_instance.stubs(:total_cost).returns(10)
+ assert_equal 30, Order.unshipped_value
+ end
+
+end
View
49 vendor/gems/mocha-0.9.5/lib/mocha.rb
@@ -0,0 +1,49 @@
+require 'mocha_standalone'
+require 'mocha/configuration'
+
+if RUBY_VERSION < '1.9'
+ begin
+ require 'rubygems'
+ begin
+ gem 'minitest', '>=1.3'
+ require 'minitest/unit'
+ rescue Gem::LoadError
+ # Compatible version of MiniTest gem not available
+ end
+ rescue LoadError
+ # RubyGems not available
+ end
+else
+ begin
+ require 'minitest/unit'
+ rescue LoadError
+ # MiniTest not available
+ end
+end
+
+if defined?(MiniTest)
+ require 'mocha/mini_test_adapter'
+
+ module MiniTest
+ class Unit
+ class TestCase
+ include Mocha::Standalone
+ include Mocha::MiniTestCaseAdapter
+ end
+ end
+ end
+end
+
+require 'mocha/test_case_adapter'
+require 'test/unit/testcase'
+
+unless Test::Unit::TestCase.ancestors.include?(Mocha::Standalone)
+ module Test
+ module Unit
+ class TestCase
+ include Mocha::Standalone
+ include Mocha::TestCaseAdapter
+ end
+ end
+ end
+end
View
55 vendor/gems/mocha-0.9.5/lib/mocha/any_instance_method.rb
@@ -0,0 +1,55 @@
+require 'mocha/class_method'
+
+module Mocha
+
+ class AnyInstanceMethod < ClassMethod
+
+ def unstub
+ remove_new_method
+ restore_original_method
+ stubbee.any_instance.reset_mocha
+ end
+
+ def mock
+ stubbee.any_instance.mocha
+ end
+
+ def hide_original_method
+ if method_exists?(method)
+ begin
+ stubbee.send(:alias_method, hidden_method, method)
+ rescue NameError
+ # deal with nasties like ActiveRecord::Associations::AssociationProxy
+ end
+ end
+ end
+
+ def define_new_method
+ stubbee.class_eval("def #{method}(*args, &block); self.class.any_instance.mocha.method_missing(:#{method}, *args, &block); end", __FILE__, __LINE__)
+ end
+
+ def remove_new_method
+ stubbee.send(:remove_method, method)
+ end
+
+ def restore_original_method
+ if method_exists?(hidden_method)
+ begin
+ stubbee.send(:alias_method, method, hidden_method)
+ stubbee.send(:remove_method, hidden_method)
+ rescue NameError
+ # deal with nasties like ActiveRecord::Associations::AssociationProxy
+ end
+ end
+ end
+
+ def method_exists?(method)
+ return true if stubbee.public_instance_methods(false).include?(method)
+ return true if stubbee.protected_instance_methods(false).include?(method)
+ return true if stubbee.private_instance_methods(false).include?(method)
+ return false
+ end
+
+ end
+
+end
View
21 vendor/gems/mocha-0.9.5/lib/mocha/argument_iterator.rb
@@ -0,0 +1,21 @@
+module Mocha
+
+ class ArgumentIterator
+
+ def initialize(argument)
+ @argument = argument
+ end
+
+ def each(&block)
+ if @argument.is_a?(Hash) then
+ @argument.each do |method_name, return_value|
+ block.call(method_name, return_value)
+ end
+ else
+ block.call(@argument)
+ end
+ end
+
+ end
+
+end
View
17 vendor/gems/mocha-0.9.5/lib/mocha/backtrace_filter.rb
@@ -0,0 +1,17 @@
+module Mocha
+
+ class BacktraceFilter
+
+ LIB_DIRECTORY = File.expand_path(File.join(File.dirname(__FILE__), "..")) + File::SEPARATOR
+
+ def initialize(lib_directory = LIB_DIRECTORY)
+ @lib_directory = lib_directory
+ end
+
+ def filtered(backtrace)
+ backtrace.reject { |location| Regexp.new(@lib_directory).match(File.expand_path(location)) }
+ end
+
+ end
+
+end
View
95 vendor/gems/mocha-0.9.5/lib/mocha/cardinality.rb
@@ -0,0 +1,95 @@
+module Mocha
+
+ class Cardinality
+
+ INFINITY = 1 / 0.0
+
+ class << self
+
+ def exactly(count)
+ new(count, count)
+ end
+
+ def at_least(count)
+ new(count, INFINITY)
+ end
+
+ def at_most(count)
+ new(0, count)
+ end
+
+ def times(range_or_count)
+ case range_or_count
+ when Range then new(range_or_count.first, range_or_count.last)
+ else new(range_or_count, range_or_count)
+ end
+ end
+
+ end
+
+ def initialize(required, maximum)
+ @required, @maximum = required, maximum
+ end
+
+ def invocations_allowed?(invocation_count)
+ invocation_count < maximum
+ end
+
+ def satisfied?(invocations_so_far)
+ invocations_so_far >= required
+ end
+
+ def needs_verifying?
+ !allowed_any_number_of_times?
+ end
+
+ def verified?(invocation_count)
+ (invocation_count >= required) && (invocation_count <= maximum)
+ end
+
+ def allowed_any_number_of_times?
+ required == 0 && infinite?(maximum)
+ end
+
+ def used?(invocation_count)
+ (invocation_count > 0) || (maximum == 0)
+ end
+
+ def mocha_inspect
+ if allowed_any_number_of_times?
+ "allowed any number of times"
+ else
+ if required == 0 && maximum == 0
+ "expected never"
+ elsif required == maximum
+ "expected exactly #{times(required)}"
+ elsif infinite?(maximum)
+ "expected at least #{times(required)}"
+ elsif required == 0
+ "expected at most #{times(maximum)}"
+ else
+ "expected between #{required} and #{times(maximum)}"
+ end
+ end
+ end
+
+ protected
+
+ attr_reader :required, :maximum
+
+ def times(number)
+ case number
+ when 0 then "no times"
+ when 1 then "once"
+ when 2 then "twice"
+ else "#{number} times"
+ end
+ end
+
+ def infinite?(number)
+ number.respond_to?(:infinite?) && number.infinite?
+ end
+
+ end
+
+end
View
27 vendor/gems/mocha-0.9.5/lib/mocha/central.rb
@@ -0,0 +1,27 @@
+module Mocha
+
+ class Central
+
+ attr_accessor :stubba_methods
+
+ def initialize
+ self.stubba_methods = []
+ end
+
+ def stub(method)
+ unless stubba_methods.include?(method)
+ method.stub
+ stubba_methods.push(method)
+ end
+ end
+
+ def unstub_all
+ while stubba_methods.length > 0
+ method = stubba_methods.pop
+ method.unstub
+ end
+ end
+
+ end
+
+end
View
19 vendor/gems/mocha-0.9.5/lib/mocha/change_state_side_effect.rb
@@ -0,0 +1,19 @@
+module Mocha
+
+ class ChangeStateSideEffect
+
+ def initialize(state)
+ @state = state
+ end
+
+ def perform
+ @state.activate
+ end
+
+ def mocha_inspect
+ "then #{@state.mocha_inspect}"
+ end
+
+ end
+
+end
View
87 vendor/gems/mocha-0.9.5/lib/mocha/class_method.rb
@@ -0,0 +1,87 @@
+require 'mocha/metaclass'
+
+module Mocha
+
+ class ClassMethod
+
+ attr_reader :stubbee, :method
+
+ def initialize(stubbee, method)
+ @stubbee = stubbee
+ @method = RUBY_VERSION < '1.9' ? method.to_s : method.to_sym
+ end
+
+ def stub
+ hide_original_method
+ define_new_method
+ end
+
+ def unstub
+ remove_new_method
+ restore_original_method
+ stubbee.reset_mocha
+ end
+
+ def mock
+ stubbee.mocha
+ end
+
+ def hide_original_method
+ if method_exists?(method)
+ begin
+ stubbee.__metaclass__.send(:alias_method, hidden_method, method)
+ rescue NameError
+ # deal with nasties like ActiveRecord::Associations::AssociationProxy
+ end
+ end
+ end
+
+ def define_new_method
+ stubbee.__metaclass__.class_eval("def #{method}(*args, &block); mocha.method_missing(:#{method}, *args, &block); end", __FILE__, __LINE__)
+ end
+
+ def remove_new_method
+ stubbee.__metaclass__.send(:remove_method, method)
+ end
+
+ def restore_original_method
+ if method_exists?(hidden_method)
+ begin
+ stubbee.__metaclass__.send(:alias_method, method, hidden_method)
+ stubbee.__metaclass__.send(:remove_method, hidden_method)
+ rescue NameError
+ # deal with nasties like ActiveRecord::Associations::AssociationProxy
+ end
+ end
+ end
+
+ def hidden_method
+ if RUBY_VERSION < '1.9'
+ method_name = method.to_s.gsub(/\W/) { |s| "_substituted_character_#{s[0]}_" }
+ else
+ method_name = method.to_s.gsub(/\W/) { |s| "_substituted_character_#{s.ord}_" }
+ end
+ hidden_method = "__stubba__#{method_name}__stubba__"
+ RUBY_VERSION < '1.9' ? hidden_method.to_s : hidden_method.to_sym
+ end
+
+ def eql?(other)
+ return false unless (other.class == self.class)
+ (stubbee.object_id == other.stubbee.object_id) and (method == other.method)
+ end
+
+ alias_method :==, :eql?
+
+ def to_s
+ "#{stubbee}.#{method}"
+ end
+
+ def method_exists?(method)
+ symbol = method.to_sym
+ metaclass = stubbee.__metaclass__
+ metaclass.public_method_defined?(symbol) || metaclass.protected_method_defined?(symbol) || metaclass.private_method_defined?(symbol)
+ end
+
+ end
+
+end
View
60 vendor/gems/mocha-0.9.5/lib/mocha/configuration.rb
@@ -0,0 +1,60 @@
+module Mocha # :nodoc:
+
+ # Configuration settings
+ class Configuration
+
+ DEFAULTS = { :stubbing_method_unnecessarily => :allow, :stubbing_method_on_non_mock_object => :allow, :stubbing_non_existent_method => :allow, :stubbing_non_public_method => :allow }
+
+ class << self
+
+ # :call-seq: allow(action)
+ #
+ # Allow the specified <tt>action</tt> (as a symbol).
+ # The <tt>actions</tt> currently available are <tt>:stubbing_method_unnecessarily, :stubbing_method_on_non_mock_object, :stubbing_non_existent_method, :stubbing_non_public_method</tt>.
+ def allow(action)
+ configuration[action] = :allow
+ end
+
+ def allow?(action) # :nodoc:
+ configuration[action] == :allow
+ end
+
+ # :call-seq: warn_when(action)
+ #
+ # Warn if the specified <tt>action</tt> (as a symbol) is attempted.
+ # The <tt>actions</tt> currently available are <tt>:stubbing_method_unnecessarily, :stubbing_method_on_non_mock_object, :stubbing_non_existent_method, :stubbing_non_public_method</tt>.
+ def warn_when(action)
+ configuration[action] = :warn
+ end
+
+ def warn_when?(action) # :nodoc:
+ configuration[action] == :warn
+ end
+
+ # :call-seq: prevent(action)
+ #
+ # Raise a StubbingError if the specified <tt>action</tt> (as a symbol) is attempted.
+ # The <tt>actions</tt> currently available are <tt>:stubbing_method_unnecessarily, :stubbing_method_on_non_mock_object, :stubbing_non_existent_method, :stubbing_non_public_method</tt>.
+ def prevent(action)
+ configuration[action] = :prevent
+ end
+
+ def prevent?(action) # :nodoc:
+ configuration[action] == :prevent
+ end
+
+ def reset_configuration # :nodoc:
+ @configuration = nil
+ end
+
+ private
+
+ def configuration # :nodoc:
+ @configuration ||= DEFAULTS.dup
+ end
+
+ end
+
+ end
+
+end
View
22 vendor/gems/mocha-0.9.5/lib/mocha/deprecation.rb
@@ -0,0 +1,22 @@
+module Mocha
+
+ class Deprecation
+
+ class << self
+
+ attr_accessor :mode, :messages
+
+ def warning(message)
+ @messages << message
+ $stderr.puts "Mocha deprecation warning: #{message}" unless mode == :disabled
+ $stderr.puts caller.join("\n ") if mode == :debug
+ end
+
+ end
+
+ self.mode = :enabled
+ self.messages = []
+
+ end
+
+end
View
17 vendor/gems/mocha-0.9.5/lib/mocha/exception_raiser.rb
@@ -0,0 +1,17 @@
+module Mocha # :nodoc:
+
+ class ExceptionRaiser # :nodoc:
+
+ def initialize(exception, message)
+ @exception, @message = exception, message
+ end
+
+ def evaluate
+ raise @exception, @exception.to_s if @exception.is_a?(Module) && @exception.ancestors.include?(Interrupt)
+ raise @exception, @message if @message
+ raise @exception
+ end
+
+ end
+
+end
View
476 vendor/gems/mocha-0.9.5/lib/mocha/expectation.rb
@@ -0,0 +1,476 @@
+require 'mocha/method_matcher'
+require 'mocha/parameters_matcher'
+require 'mocha/expectation_error'
+require 'mocha/return_values'
+require 'mocha/exception_raiser'
+require 'mocha/yield_parameters'
+require 'mocha/is_a'
+require 'mocha/in_state_ordering_constraint'
+require 'mocha/change_state_side_effect'
+require 'mocha/cardinality'
+
+module Mocha # :nodoc:
+
+ # Methods on expectations returned from Mock#expects, Mock#stubs, Object#expects and Object#stubs.
+ class Expectation
+
+ # :call-seq: times(range) -> expectation
+ #
+ # Modifies expectation so that the number of calls to the expected method must be within a specific +range+.
+ #
+ # +range+ can be specified as an exact integer or as a range of integers
+ # object = mock()
+ # object.expects(:expected_method).times(3)
+ # 3.times { object.expected_method }
+ # # => verify succeeds
+ #
+ # object = mock()
+ # object.expects(:expected_method).times(3)
+ # 2.times { object.expected_method }
+ # # => verify fails
+ #
+ # object = mock()
+ # object.expects(:expected_method).times(2..4)
+ # 3.times { object.expected_method }
+ # # => verify succeeds
+ #
+ # object = mock()
+ # object.expects(:expected_method).times(2..4)
+ # object.expected_method
+ # # => verify fails
+ def times(range)
+ @cardinality = Cardinality.times(range)
+ self
+ end
+
+ # :call-seq: twice() -> expectation
+ #
+ # Modifies expectation so that the expected method must be called exactly twice.
+ # object = mock()
+ # object.expects(:expected_method).twice
+ # object.expected_method
+ # object.expected_method
+ # # => verify succeeds
+ #
+ # object = mock()
+ # object.expects(:expected_method).twice
+ # object.expected_method
+ # object.expected_method
+ # object.expected_method
+ # # => verify fails
+ #
+ # object = mock()
+ # object.expects(:expected_method).twice
+ # object.expected_method
+ # # => verify fails
+ def twice
+ @cardinality = Cardinality.exactly(2)
+ self
+ end
+
+ # :call-seq: once() -> expectation
+ #
+ # Modifies expectation so that the expected method must be called exactly once.
+ # Note that this is the default behaviour for an expectation, but you may wish to use it for clarity/emphasis.
+ # object = mock()
+ # object.expects(:expected_method).once
+ # object.expected_method
+ # # => verify succeeds
+ #
+ # object = mock()
+ # object.expects(:expected_method).once
+ # object.expected_method
+ # object.expected_method
+ # # => verify fails
+ #
+ # object = mock()
+ # object.expects(:expected_method).once
+ # # => verify fails
+ def once
+ @cardinality = Cardinality.exactly(1)
+ self
+ end
+
+ # :call-seq: never() -> expectation
+ #
+ # Modifies expectation so that the expected method must never be called.
+ # object = mock()
+ # object.expects(:expected_method).never
+ # object.expected_method
+ # # => verify fails
+ #
+ # object = mock()
+ # object.expects(:expected_method).never
+ # object.expected_method
+ # # => verify succeeds
+ def never
+ @cardinality = Cardinality.exactly(0)
+ self
+ end
+
+ # :call-seq: at_least(minimum_number_of_times) -> expectation
+ #
+ # Modifies expectation so that the expected method must be called at least a +minimum_number_of_times+.
+ # object = mock()
+ # object.expects(:expected_method).at_least(2)
+ # 3.times { object.expected_method }
+ # # => verify succeeds
+ #
+ # object = mock()
+ # object.expects(:expected_method).at_least(2)
+ # object.expected_method
+ # # => verify fails
+ def at_least(minimum_number_of_times)
+ @cardinality = Cardinality.at_least(minimum_number_of_times)
+ self
+ end
+
+ # :call-seq: at_least_once() -> expectation
+ #
+ # Modifies expectation so that the expected method must be called at least once.
+ # object = mock()
+ # object.expects(:expected_method).at_least_once
+ # object.expected_method
+ # # => verify succeeds
+ #
+ # object = mock()
+ # object.expects(:expected_method).at_least_once
+ # # => verify fails
+ def at_least_once
+ at_least(1)
+ self
+ end
+
+ # :call-seq: at_most(maximum_number_of_times) -> expectation
+ #
+ # Modifies expectation so that the expected method must be called at most a +maximum_number_of_times+.
+ # object = mock()
+ # object.expects(:expected_method).at_most(2)
+ # 2.times { object.expected_method }
+ # # => verify succeeds
+ #
+ # object = mock()
+ # object.expects(:expected_method).at_most(2)
+ # 3.times { object.expected_method }
+ # # => verify fails
+ def at_most(maximum_number_of_times)
+ @cardinality = Cardinality.at_most(maximum_number_of_times)
+ self
+ end
+
+ # :call-seq: at_most_once() -> expectation
+ #
+ # Modifies expectation so that the expected method must be called at most once.
+ # object = mock()
+ # object.expects(:expected_method).at_most_once
+ # object.expected_method
+ # # => verify succeeds
+ #
+ # object = mock()
+ # object.expects(:expected_method).at_most_once
+ # 2.times { object.expected_method }
+ # # => verify fails
+ def at_most_once()
+ at_most(1)
+ self
+ end
+
+ # :call-seq: with(*expected_parameters, &matching_block) -> expectation
+ #
+ # Modifies expectation so that the expected method must be called with +expected_parameters+.
+ # object = mock()
+ # object.expects(:expected_method).with(:param1, :param2)
+ # object.expected_method(:param1, :param2)
+ # # => verify succeeds
+ #
+ # object = mock()
+ # object.expects(:expected_method).with(:param1, :param2)
+ # object.expected_method(:param3)
+ # # => verify fails
+ # May be used with parameter matchers in Mocha::ParameterMatchers.
+ #
+ # If a +matching_block+ is given, the block is called with the parameters passed to the expected method.
+ # The expectation is matched if the block evaluates to +true+.
+ # object = mock()
+ # object.expects(:expected_method).with() { |value| value % 4 == 0 }
+ # object.expected_method(16)
+ # # => verify succeeds
+ #
+ # object = mock()
+ # object.expects(:expected_method).with() { |value| value % 4 == 0 }
+ # object.expected_method(17)
+ # # => verify fails
+ def with(*expected_parameters, &matching_block)
+ @parameters_matcher = ParametersMatcher.new(expected_parameters, &matching_block)
+ self
+ end
+
+ # :call-seq: yields(*parameters) -> expectation
+ #
+ # Modifies expectation so that when the expected method is called, it yields with the specified +parameters+.
+ # object = mock()
+ # object.expects(:expected_method).yields('result')
+ # yielded_value = nil
+ # object.expected_method { |value| yielded_value = value }
+ # yielded_value # => 'result'
+ # May be called multiple times on the same expectation for consecutive invocations. Also see Expectation#then.
+ # object = mock()
+ # object.stubs(:expected_method).yields(1).then.yields(2)
+ # yielded_values_from_first_invocation = []
+ # yielded_values_from_second_invocation = []
+ # object.expected_method { |value| yielded_values_from_first_invocation << value } # first invocation
+ # object.expected_method { |value| yielded_values_from_second_invocation << value } # second invocation
+ # yielded_values_from_first_invocation # => [1]
+ # yielded_values_from_second_invocation # => [2]
+ def yields(*parameters)
+ @yield_parameters.add(*parameters)
+ self
+ end
+
+ # :call-seq: multiple_yields(*parameter_groups) -> expectation
+ #
+ # Modifies expectation so that when the expected method is called, it yields multiple times per invocation with the specified +parameter_groups+.
+ # object = mock()
+ # object.expects(:expected_method).multiple_yields(['result_1', 'result_2'], ['result_3'])
+ # yielded_values = []
+ # object.expected_method { |*values| yielded_values << values }
+ # yielded_values # => [['result_1', 'result_2'], ['result_3]]
+ # May be called multiple times on the same expectation for consecutive invocations. Also see Expectation#then.
+ # object = mock()
+ # object.stubs(:expected_method).multiple_yields([1, 2], [3]).then.multiple_yields([4], [5, 6])
+ # yielded_values_from_first_invocation = []
+ # yielded_values_from_second_invocation = []
+ # object.expected_method { |*values| yielded_values_from_first_invocation << values } # first invocation
+ # object.expected_method { |*values| yielded_values_from_second_invocation << values } # second invocation
+ # yielded_values_from_first_invocation # => [[1, 2], [3]]
+ # yielded_values_from_second_invocation # => [[4], [5, 6]]
+ def multiple_yields(*parameter_groups)
+ @yield_parameters.multiple_add(*parameter_groups)
+ self
+ end
+
+ # :call-seq: returns(value) -> expectation
+ # returns(*values) -> expectation
+ #
+ # Modifies expectation so that when the expected method is called, it returns the specified +value+.
+ # object = mock()
+ # object.stubs(:stubbed_method).returns('result')
+ # object.stubbed_method # => 'result'
+ # object.stubbed_method # => 'result'
+ # If multiple +values+ are given, these are returned in turn on consecutive calls to the method.
+ # object = mock()
+ # object.stubs(:stubbed_method).returns(1, 2)
+ # object.stubbed_method # => 1
+ # object.stubbed_method # => 2
+ # May be called multiple times on the same expectation. Also see Expectation#then.
+ # object = mock()
+ # object.stubs(:expected_method).returns(1, 2).then.returns(3)
+ # object.expected_method # => 1
+ # object.expected_method # => 2
+ # object.expected_method # => 3
+ # May be called in conjunction with Expectation#raises on the same expectation.
+ # object = mock()
+ # object.stubs(:expected_method).returns(1, 2).then.raises(Exception)
+ # object.expected_method # => 1
+ # object.expected_method # => 2
+ # object.expected_method # => raises exception of class Exception1
+ # Note that in Ruby a method returning multiple values is exactly equivalent to a method returning an Array of those values.
+ # object = mock()
+ # object.stubs(:expected_method).returns([1, 2])
+ # x, y = object.expected_method
+ # x # => 1
+ # y # => 2
+ def returns(*values)
+ @return_values += ReturnValues.build(*values)
+ self
+ end
+
+ # :call-seq: raises(exception = RuntimeError, message = nil) -> expectation
+ #
+ # Modifies expectation so that when the expected method is called, it raises the specified +exception+ with the specified +message+.
+ # object = mock()
+ # object.expects(:expected_method).raises(Exception, 'message')
+ # object.expected_method # => raises exception of class Exception and with message 'message'
+ # May be called multiple times on the same expectation. Also see Expectation#then.
+ # object = mock()
+ # object.stubs(:expected_method).raises(Exception1).then.raises(Exception2)
+ # object.expected_method # => raises exception of class Exception1
+ # object.expected_method # => raises exception of class Exception2
+ # May be called in conjunction with Expectation#returns on the same expectation.
+ # object = mock()
+ # object.stubs(:expected_method).raises(Exception).then.returns(2, 3)
+ # object.expected_method # => raises exception of class Exception1
+ # object.expected_method # => 2
+ # object.expected_method # => 3
+ def raises(exception = RuntimeError, message = nil)
+ @return_values += ReturnValues.new(ExceptionRaiser.new(exception, message))
+ self
+ end
+
+ # :call-seq: then() -> expectation
+ # then(state_machine.is(state)) -> expectation
+ #
+ # <tt>then()</tt> is used as syntactic sugar to improve readability. It has no effect on state of the expectation.
+ # object = mock()
+ # object.stubs(:expected_method).returns(1, 2).then.raises(Exception).then.returns(4)
+ # object.expected_method # => 1
+ # object.expected_method # => 2
+ # object.expected_method # => raises exception of class Exception
+ # object.expected_method # => 4
+ #
+ # <tt>then(state_machine.is(state))</tt> is used to change the +state_machine+ to the specified +state+ when the invocation occurs.
+ #
+ # See also Standalone#states, StateMachine and Expectation#when.
+ # power = states('power').starts_as('off')
+ #
+ # radio = mock('radio')
+ # radio.expects(:switch_on).then(power.is('on'))
+ # radio.expects(:select_channel).with('BBC Radio 4').when(power.is('on'))
+ # radio.expects(:adjust_volume).with(+5).when(power.is('on'))
+ # radio.expects(:select_channel).with('BBC World Service').when(power.is('on'))
+ # radio.expects(:adjust_volume).with(-5).when(power.is('on'))
+ # radio.expects(:switch_off).then(power.is('off'))
+ def then(*parameters)
+ if parameters.length == 1
+ state = parameters.first
+ add_side_effect(ChangeStateSideEffect.new(state))
+ end
+ self
+ end
+
+ # :call-seq: when(state_machine.is(state)) -> exception
+ #
+ # Constrains the expectation to occur only when the +state_machine+ is in the named +state+.
+ #
+ # See also Standalone#states, StateMachine#starts_as and Expectation#then.
+ # power = states('power').starts_as('off')
+ #
+ # radio = mock('radio')
+ # radio.expects(:switch_on).then(power.is('on'))
+ # radio.expects(:select_channel).with('BBC Radio 4').when(power.is('on'))
+ # radio.expects(:adjust_volume).with(+5).when(power.is('on'))
+ # radio.expects(:select_channel).with('BBC World Service').when(power.is('on'))
+ # radio.expects(:adjust_volume).with(-5).when(power.is('on'))
+ # radio.expects(:switch_off).then(power.is('off'))
+ def when(state_predicate)
+ add_ordering_constraint(InStateOrderingConstraint.new(state_predicate))
+ self
+ end
+
+ # :call-seq: in_sequence(*sequences) -> expectation
+ #
+ # Constrains this expectation so that it must be invoked at the current point in the sequence.
+ #
+ # To expect a sequence of invocations, write the expectations in order and add the in_sequence(sequence) clause to each one.
+ #
+ # Expectations in a sequence can have any invocation count.
+ #
+ # If an expectation in a sequence is stubbed, rather than expected, it can be skipped in the sequence.
+ #
+ # See also Standalone#sequence.
+ # breakfast = sequence('breakfast')
+ #
+ # egg = mock('egg')
+ # egg.expects(:crack).in_sequence(breakfast)
+ # egg.expects(:fry).in_sequence(breakfast)
+ # egg.expects(:eat).in_sequence(breakfast)
+ def in_sequence(*sequences)
+ sequences.each { |sequence| add_in_sequence_ordering_constraint(sequence) }
+ self
+ end
+
+ # :stopdoc:
+
+ attr_reader :backtrace
+
+ def initialize(mock, expected_method_name, backtrace = nil)
+ @mock = mock
+ @method_matcher = MethodMatcher.new(expected_method_name.to_sym)
+ @parameters_matcher = ParametersMatcher.new
+ @ordering_constraints = []
+ @side_effects = []
+ @cardinality, @invocation_count = Cardinality.exactly(1), 0
+ @return_values = ReturnValues.new
+ @yield_parameters = YieldParameters.new
+ @backtrace = backtrace || caller
+ end
+
+ def add_ordering_constraint(ordering_constraint)
+ @ordering_constraints << ordering_constraint
+ end
+
+ def add_in_sequence_ordering_constraint(sequence)
+ sequence.constrain_as_next_in_sequence(self)
+ end
+
+ def add_side_effect(side_effect)
+ @side_effects << side_effect
+ end
+
+ def perform_side_effects
+ @side_effects.each { |side_effect| side_effect.perform }
+ end
+
+ def in_correct_order?
+ @ordering_constraints.all? { |ordering_constraint| ordering_constraint.allows_invocation_now? }
+ end
+
+ def matches_method?(method_name)
+ @method_matcher.match?(method_name)
+ end
+
+ def match?(actual_method_name, *actual_parameters)
+ @method_matcher.match?(actual_method_name) && @parameters_matcher.match?(actual_parameters) && in_correct_order?
+ end
+
+ def invocations_allowed?
+ @cardinality.invocations_allowed?(@invocation_count)
+ end
+
+ def satisfied?
+ @cardinality.satisfied?(@invocation_count)
+ end
+
+ def invoke
+ @invocation_count += 1
+ perform_side_effects()
+ if block_given? then
+ @yield_parameters.next_invocation.each do |yield_parameters|
+ yield(*yield_parameters)
+ end
+ end
+ @return_values.next
+ end
+
+ def verified?(assertion_counter = nil)
+ assertion_counter.increment if assertion_counter && @cardinality.needs_verifying?
+ @cardinality.verified?(@invocation_count)
+ end
+
+ def used?
+ @cardinality.used?(@invocation_count)
+ end
+
+ def mocha_inspect
+ message = "#{@cardinality.mocha_inspect}, "
+ message << case @invocation_count
+ when 0 then "not yet invoked"
+ when 1 then "already invoked once"
+ when 2 then "already invoked twice"
+ else "already invoked #{@invocation_count} times"
+ end
+ message << ": "
+ message << method_signature
+ message << "; #{@ordering_constraints.map { |oc| oc.mocha_inspect }.join("; ")}" unless @ordering_constraints.empty?
+ message
+ end
+
+ def method_signature
+ "#{@mock.mocha_inspect}.#{@me