rr 1.1.1 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (223) hide show
  1. checksums.yaml +5 -5
  2. data/Appraisals +6 -0
  3. data/CHANGES.md +102 -1
  4. data/CREDITS.md +5 -0
  5. data/Gemfile +3 -0
  6. data/README.md +91 -110
  7. data/Rakefile +43 -0
  8. data/doc/02_syntax_comparison.md +1 -0
  9. data/gemfiles/ruby_19_rspec_2.gemfile +14 -0
  10. data/gemfiles/ruby_19_rspec_2.gemfile.lock +49 -0
  11. data/gemfiles/ruby_19_rspec_2_rails_4.gemfile +15 -0
  12. data/gemfiles/ruby_19_rspec_2_rails_4.gemfile.lock +119 -0
  13. data/lib/rr/class_instance_method_defined.rb +1 -1
  14. data/lib/rr/core_ext/array.rb +2 -0
  15. data/lib/rr/core_ext/hash.rb +2 -0
  16. data/lib/rr/deprecations.rb +97 -0
  17. data/lib/rr/double.rb +28 -10
  18. data/lib/rr/double_definitions/double_definition.rb +39 -16
  19. data/lib/rr/double_definitions/double_definition_create.rb +5 -5
  20. data/lib/rr/double_definitions/double_definition_create_blank_slate.rb +10 -4
  21. data/lib/rr/double_definitions/double_injections/any_instance_of.rb +1 -1
  22. data/lib/rr/double_definitions/double_injections/instance.rb +2 -2
  23. data/lib/rr/double_definitions/strategies/strategy.rb +27 -8
  24. data/lib/rr/double_definitions/strategies/verification/mock.rb +8 -2
  25. data/lib/rr/double_matches.rb +4 -3
  26. data/lib/rr/dsl.rb +152 -0
  27. data/lib/rr/expectations/any_argument_expectation.rb +4 -4
  28. data/lib/rr/expectations/argument_equality_expectation.rb +43 -5
  29. data/lib/rr/injections/double_injection.rb +67 -19
  30. data/lib/rr/injections/method_missing_injection.rb +37 -6
  31. data/lib/rr/integrations.rb +13 -12
  32. data/lib/rr/integrations/decorator.rb +4 -1
  33. data/lib/rr/integrations/minitest_4.rb +1 -1
  34. data/lib/rr/integrations/minitest_4_active_support.rb +1 -1
  35. data/lib/rr/integrations/rspec/invocation_matcher.rb +0 -8
  36. data/lib/rr/integrations/rspec_2.rb +28 -3
  37. data/lib/rr/keyword_arguments.rb +15 -0
  38. data/lib/rr/method_dispatches/base_method_dispatch.rb +22 -5
  39. data/lib/rr/method_dispatches/method_dispatch.rb +21 -10
  40. data/lib/rr/method_dispatches/method_missing_dispatch.rb +14 -5
  41. data/lib/rr/recorded_call.rb +35 -0
  42. data/lib/rr/recorded_calls.rb +23 -9
  43. data/lib/rr/space.rb +15 -5
  44. data/lib/rr/spy_verification.rb +13 -5
  45. data/lib/rr/version.rb +1 -2
  46. data/lib/rr/wildcard_matchers.rb +10 -10
  47. data/lib/rr/without_autohook.rb +7 -14
  48. data/rr.gemspec +14 -5
  49. data/spec/custom_formatter_for_rspec.rb +18 -0
  50. data/spec/custom_formatter_for_rspec_2.rb +40 -0
  51. data/spec/defines_spec_suite_tasks.rb +57 -0
  52. data/spec/fixtures/rubygems_patch_for_187.rb +598 -0
  53. data/spec/global_helper.rb +38 -0
  54. data/spec/spec.opts +3 -0
  55. data/spec/spec_suite_configuration.rb +126 -0
  56. data/spec/spec_suite_runner.rb +47 -0
  57. data/spec/suites.yml +10 -0
  58. data/spec/suites/rspec_2/functional/any_instance_of_spec.rb +147 -0
  59. data/spec/suites/rspec_2/functional/dont_allow_spec.rb +17 -0
  60. data/spec/suites/rspec_2/functional/mock_bang_spec.rb +20 -0
  61. data/spec/suites/rspec_2/functional/mock_instance_of_spec.rb +14 -0
  62. data/spec/suites/rspec_2/functional/mock_instance_of_strong_spec.rb +15 -0
  63. data/spec/suites/rspec_2/functional/mock_proxy_instance_of_spec.rb +15 -0
  64. data/spec/suites/rspec_2/functional/mock_proxy_spec.rb +14 -0
  65. data/spec/suites/rspec_2/functional/mock_spec.rb +17 -0
  66. data/spec/suites/rspec_2/functional/mock_strong_spec.rb +14 -0
  67. data/spec/suites/rspec_2/functional/received_spec.rb +16 -0
  68. data/spec/suites/rspec_2/functional/spy_spec.rb +102 -0
  69. data/spec/suites/rspec_2/functional/stub_bang_spec.rb +20 -0
  70. data/spec/suites/rspec_2/functional/stub_instance_of_spec.rb +15 -0
  71. data/spec/suites/rspec_2/functional/stub_instance_of_strong_spec.rb +15 -0
  72. data/spec/suites/rspec_2/functional/stub_proxy_instance_of_spec.rb +16 -0
  73. data/spec/suites/rspec_2/functional/stub_proxy_spec.rb +45 -0
  74. data/spec/suites/rspec_2/functional/stub_spec.rb +71 -0
  75. data/spec/suites/rspec_2/functional/stub_strong_spec.rb +15 -0
  76. data/spec/suites/rspec_2/functional/wildcard_matchers_spec.rb +128 -0
  77. data/spec/suites/rspec_2/helper.rb +28 -0
  78. data/spec/suites/rspec_2/integration/minitest_4_spec.rb +109 -0
  79. data/spec/suites/rspec_2/integration/minitest_spec.rb +109 -0
  80. data/spec/suites/rspec_2/spec_helper.rb +3 -0
  81. data/spec/suites/rspec_2/support/matchers/wildcard_matcher_matchers.rb +32 -0
  82. data/spec/suites/rspec_2/support/mixins/double_definition_creator_helpers.rb +173 -0
  83. data/spec/suites/rspec_2/support/mixins/mock_definition_creator_helpers.rb +45 -0
  84. data/spec/suites/rspec_2/support/mixins/proxy_definition_creator_helpers.rb +33 -0
  85. data/spec/suites/rspec_2/support/mixins/stub_creator_helpers.rb +43 -0
  86. data/spec/suites/rspec_2/support/mixins/stub_definition_creator_helpers.rb +45 -0
  87. data/spec/suites/rspec_2/support/shared_contexts/double_definition_creators/argument_expectations_with_never_called_qualifier.rb +39 -0
  88. data/spec/suites/rspec_2/support/shared_contexts/double_definition_creators/argument_expectations_with_times_called_qualifier.rb +50 -0
  89. data/spec/suites/rspec_2/support/shared_contexts/double_definition_creators/argument_expectations_without_qualifiers.rb +131 -0
  90. data/spec/suites/rspec_2/support/shared_contexts/double_definition_creators/dont_allow.rb +148 -0
  91. data/spec/suites/rspec_2/support/shared_contexts/double_definition_creators/mock_instance_of.rb +26 -0
  92. data/spec/suites/rspec_2/support/shared_contexts/double_definition_creators/mock_instance_of_strong.rb +28 -0
  93. data/spec/suites/rspec_2/support/shared_contexts/double_definition_creators/mock_proxy.rb +11 -0
  94. data/spec/suites/rspec_2/support/shared_contexts/double_definition_creators/mock_strong.rb +37 -0
  95. data/spec/suites/rspec_2/support/shared_contexts/double_definition_creators/mocking.rb +107 -0
  96. data/spec/suites/rspec_2/support/shared_contexts/double_definition_creators/stub_instance_of.rb +32 -0
  97. data/spec/suites/rspec_2/support/shared_contexts/double_definition_creators/stub_instance_of_strong.rb +39 -0
  98. data/spec/suites/rspec_2/support/shared_contexts/double_definition_creators/stub_proxy.rb +11 -0
  99. data/spec/suites/rspec_2/support/shared_contexts/double_definition_creators/stub_strong.rb +37 -0
  100. data/spec/suites/rspec_2/support/shared_contexts/double_definition_creators/stubbing.rb +57 -0
  101. data/spec/suites/rspec_2/support/shared_examples/double_definition_creators/array_flatten_bug.rb +35 -0
  102. data/spec/suites/rspec_2/support/shared_examples/double_definition_creators/block_form.rb +31 -0
  103. data/spec/suites/rspec_2/support/shared_examples/double_definition_creators/comparing_arity.rb +63 -0
  104. data/spec/suites/rspec_2/support/shared_examples/double_definition_creators/object_is_proxy.rb +43 -0
  105. data/spec/suites/rspec_2/support/shared_examples/double_definition_creators/sequential_invocations.rb +26 -0
  106. data/spec/suites/rspec_2/support/shared_examples/double_definition_creators/setting_implementation.rb +51 -0
  107. data/spec/suites/rspec_2/support/shared_examples/double_definition_creators/yields.rb +81 -0
  108. data/spec/suites/rspec_2/support/shared_examples/space.rb +13 -0
  109. data/spec/suites/rspec_2/support/shared_examples/times_called_expectation.rb +9 -0
  110. data/spec/suites/rspec_2/unit/core_ext/array_spec.rb +39 -0
  111. data/spec/suites/rspec_2/unit/core_ext/enumerable_spec.rb +53 -0
  112. data/spec/suites/rspec_2/unit/core_ext/hash_spec.rb +55 -0
  113. data/spec/suites/rspec_2/unit/core_ext/range_spec.rb +41 -0
  114. data/spec/suites/rspec_2/unit/core_ext/regexp_spec.rb +41 -0
  115. data/spec/suites/rspec_2/unit/deprecations_spec.rb +27 -0
  116. data/spec/suites/rspec_2/unit/double_definitions/child_double_definition_create_spec.rb +114 -0
  117. data/spec/suites/rspec_2/unit/double_definitions/double_definition_create_blank_slate_spec.rb +93 -0
  118. data/spec/suites/rspec_2/unit/double_definitions/double_definition_create_spec.rb +446 -0
  119. data/spec/suites/rspec_2/unit/dsl/double_creators_spec.rb +133 -0
  120. data/spec/suites/rspec_2/unit/dsl/space_spec.rb +99 -0
  121. data/spec/suites/rspec_2/unit/dsl/wildcard_matchers_spec.rb +67 -0
  122. data/spec/suites/rspec_2/unit/errors/rr_error_spec.rb +67 -0
  123. data/spec/suites/rspec_2/unit/expectations/any_argument_expectation_spec.rb +48 -0
  124. data/spec/suites/rspec_2/unit/expectations/anything_argument_equality_expectation_spec.rb +14 -0
  125. data/spec/suites/rspec_2/unit/expectations/argument_equality_expectation_spec.rb +135 -0
  126. data/spec/suites/rspec_2/unit/expectations/boolean_argument_equality_expectation_spec.rb +30 -0
  127. data/spec/suites/rspec_2/unit/expectations/hash_including_argument_equality_expectation_spec.rb +92 -0
  128. data/spec/suites/rspec_2/unit/expectations/satisfy_argument_equality_expectation_spec.rb +61 -0
  129. data/spec/suites/rspec_2/unit/expectations/times_called_expectation/any_times_matcher_spec.rb +22 -0
  130. data/spec/suites/rspec_2/unit/expectations/times_called_expectation/at_least_matcher_spec.rb +37 -0
  131. data/spec/suites/rspec_2/unit/expectations/times_called_expectation/at_most_matcher_spec.rb +43 -0
  132. data/spec/suites/rspec_2/unit/expectations/times_called_expectation/integer_matcher_spec.rb +58 -0
  133. data/spec/suites/rspec_2/unit/expectations/times_called_expectation/proc_matcher_spec.rb +35 -0
  134. data/spec/suites/rspec_2/unit/expectations/times_called_expectation/range_matcher_spec.rb +39 -0
  135. data/spec/suites/rspec_2/unit/hash_with_object_id_key_spec.rb +88 -0
  136. data/spec/suites/rspec_2/unit/injections/double_injection/double_injection_spec.rb +533 -0
  137. data/spec/suites/rspec_2/unit/injections/double_injection/double_injection_verify_spec.rb +32 -0
  138. data/spec/suites/rspec_2/unit/integrations/rspec/invocation_matcher_spec.rb +297 -0
  139. data/spec/suites/rspec_2/unit/integrations/rspec_spec.rb +70 -0
  140. data/spec/suites/rspec_2/unit/rr_spec.rb +28 -0
  141. data/spec/suites/rspec_2/unit/space_spec.rb +598 -0
  142. data/spec/suites/rspec_2/unit/spy_verification_spec.rb +133 -0
  143. data/spec/suites/rspec_2/unit/times_called_matchers/any_times_matcher_spec.rb +46 -0
  144. data/spec/suites/rspec_2/unit/times_called_matchers/at_least_matcher_spec.rb +54 -0
  145. data/spec/suites/rspec_2/unit/times_called_matchers/at_most_matcher_spec.rb +69 -0
  146. data/spec/suites/rspec_2/unit/times_called_matchers/integer_matcher_spec.rb +69 -0
  147. data/spec/suites/rspec_2/unit/times_called_matchers/proc_matcher_spec.rb +54 -0
  148. data/spec/suites/rspec_2/unit/times_called_matchers/range_matcher_spec.rb +75 -0
  149. data/spec/suites/rspec_2/unit/times_called_matchers/times_called_matcher_spec.rb +117 -0
  150. data/spec/suites/rspec_2/unit/wildcard_matchers/anything_spec.rb +33 -0
  151. data/spec/suites/rspec_2/unit/wildcard_matchers/boolean_spec.rb +45 -0
  152. data/spec/suites/rspec_2/unit/wildcard_matchers/duck_type_spec.rb +64 -0
  153. data/spec/suites/rspec_2/unit/wildcard_matchers/hash_including_spec.rb +64 -0
  154. data/spec/suites/rspec_2/unit/wildcard_matchers/is_a_spec.rb +55 -0
  155. data/spec/suites/rspec_2/unit/wildcard_matchers/numeric_spec.rb +46 -0
  156. data/spec/suites/rspec_2/unit/wildcard_matchers/satisfy_spec.rb +57 -0
  157. data/spec/support/adapter.rb +22 -0
  158. data/spec/support/adapter_tests/base.rb +45 -0
  159. data/spec/support/adapter_tests/minitest.rb +7 -0
  160. data/spec/support/adapter_tests/rspec.rb +70 -0
  161. data/spec/support/adapter_tests/test_unit.rb +47 -0
  162. data/spec/support/command_runner.rb +105 -0
  163. data/spec/support/generator.rb +56 -0
  164. data/spec/support/integration_tests/base.rb +64 -0
  165. data/spec/support/integration_tests/rails.rb +60 -0
  166. data/spec/support/integration_tests/rails_minitest.rb +13 -0
  167. data/spec/support/integration_tests/rails_rspec.rb +13 -0
  168. data/spec/support/integration_tests/rails_test_unit.rb +13 -0
  169. data/spec/support/integration_tests/rails_test_unit_like.rb +13 -0
  170. data/spec/support/integration_tests/ruby.rb +7 -0
  171. data/spec/support/integration_tests/ruby_minitest.rb +13 -0
  172. data/spec/support/integration_tests/ruby_rspec.rb +13 -0
  173. data/spec/support/integration_tests/ruby_test_unit.rb +13 -0
  174. data/spec/support/matchers/be_a_subset_of_matcher.rb +24 -0
  175. data/spec/support/project/cucumber.rb +50 -0
  176. data/spec/support/project/generator.rb +348 -0
  177. data/spec/support/project/minitest.rb +39 -0
  178. data/spec/support/project/rails.rb +199 -0
  179. data/spec/support/project/rails_minitest.rb +17 -0
  180. data/spec/support/project/rails_rspec.rb +50 -0
  181. data/spec/support/project/rails_test_unit.rb +17 -0
  182. data/spec/support/project/rails_test_unit_like.rb +17 -0
  183. data/spec/support/project/rspec.rb +69 -0
  184. data/spec/support/project/ruby.rb +34 -0
  185. data/spec/support/project/ruby_minitest.rb +11 -0
  186. data/spec/support/project/ruby_rspec.rb +29 -0
  187. data/spec/support/project/ruby_test_unit.rb +11 -0
  188. data/spec/support/project/ruby_test_unit_like.rb +21 -0
  189. data/spec/support/project/test_unit.rb +29 -0
  190. data/spec/support/project/test_unit_like.rb +7 -0
  191. data/spec/support/project/tests_runner.rb +22 -0
  192. data/spec/support/test.sqlite3 +0 -0
  193. data/spec/support/test_case/generator.rb +53 -0
  194. data/spec/support/test_case/minitest.rb +13 -0
  195. data/spec/support/test_case/rspec.rb +19 -0
  196. data/spec/support/test_case/test_unit.rb +21 -0
  197. data/spec/support/test_file/generator.rb +120 -0
  198. data/spec/support/test_file/minitest.rb +19 -0
  199. data/spec/support/test_file/rails_minitest.rb +7 -0
  200. data/spec/support/test_file/rails_rspec.rb +12 -0
  201. data/spec/support/test_file/rails_test_unit.rb +25 -0
  202. data/spec/support/test_file/rspec.rb +33 -0
  203. data/spec/support/test_file/test_unit.rb +36 -0
  204. data/spec/support/test_helper/generator.rb +27 -0
  205. data/spec/support/test_helper/minitest.rb +7 -0
  206. data/spec/support/test_helper/rails.rb +31 -0
  207. data/spec/support/test_helper/rails_minitest.rb +7 -0
  208. data/spec/support/test_helper/rails_rspec.rb +25 -0
  209. data/spec/support/test_helper/rails_test_unit.rb +23 -0
  210. data/spec/support/test_helper/rspec.rb +7 -0
  211. data/spec/support/test_helper/ruby.rb +31 -0
  212. data/spec/support/test_helper/test_unit.rb +7 -0
  213. metadata +240 -19
  214. data/VERSION +0 -1
  215. data/lib/rr/adapters.rb +0 -44
  216. data/lib/rr/adapters/rr_methods.rb +0 -142
  217. data/lib/rr/integrations/rspec_1.rb +0 -46
  218. data/lib/rr/integrations/test_unit_1.rb +0 -63
  219. data/lib/rr/integrations/test_unit_2.rb +0 -15
  220. data/lib/rr/integrations/test_unit_200.rb +0 -27
  221. data/lib/rr/integrations/test_unit_200_active_support.rb +0 -25
  222. data/lib/rr/integrations/test_unit_2_active_support.rb +0 -38
  223. data/lib/rr/proc_from_block.rb +0 -11
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: ba1e0b3ea37112b713b116b3f42156d3d0269717
4
- data.tar.gz: 3e933262c2d9a50a495497067508d154e1d9ec9b
2
+ SHA256:
3
+ metadata.gz: a67997dc1e6efa65e6b99101306915242163d3d6b65f73cec7a1ba2e3dbb3229
4
+ data.tar.gz: 34ed2995cdf97291cb5f1334737d8fc93dbd9078a420197635a307414d61255c
5
5
  SHA512:
6
- metadata.gz: 92301ad0c0e78016f5c10ca7c406a19612398a45b595892de2912159fd2b878ceaecf57b02a043332b5e086d0f45ab618989b79d501d1ad8b90982ff5469a1f7
7
- data.tar.gz: 0109fbc48ec0aac6ae07f3fecb9af272311c73deeaae702c61b705beb7429f5fb367406d8475b12ebb918f09840bb70ce0e430034958b8861f0674ab10bb4b71
6
+ metadata.gz: 0bb271fe1108d5b1fc1b35c8c14d1d38bcf2254e9863a7cc48d8e20ca67aabc3ee6d02e8cb9bcd30875c285a3b5c14e3386faa31b7907f04be501678025a5278
7
+ data.tar.gz: 85641d68043365de3f062ef34164492ba69c5be725b14a12eef75f06895df73a05dbea3d53d196e6f3402d1f4ce108bcc2bdc2b8c65e2bfb015d2f7d7f6bff7c
data/Appraisals ADDED
@@ -0,0 +1,6 @@
1
+ appraise 'ruby_19_rspec_2' do
2
+ end
3
+
4
+ appraise 'ruby_19_rspec_2_rails_4' do
5
+ gem 'rails', '4.0.0'
6
+ end
data/CHANGES.md CHANGED
@@ -1,6 +1,104 @@
1
1
  # Changelog
2
2
 
3
- ## 1.1.1 (UNRELEASED)
3
+ ## 3.0.0 - 2021-03-31
4
+
5
+ ### Improvements
6
+
7
+ * Added support for Ruby 3.0's keyword arguments.
8
+ [GitHub#17][Reported by Takuro Ashie]
9
+
10
+ ### Fixes
11
+
12
+ * Fixed a bug that `any_instance_of` doesn't work with class
13
+ hierarchies. [GitHub#12][Reported by Étienne Barrié]
14
+
15
+ ### Thanks
16
+
17
+ * Étienne Barrié
18
+
19
+ * Takuro Ashie
20
+
21
+ ## 1.2.1 - 2017-06-22
22
+
23
+ ### Fixes
24
+
25
+ * Fixed a bug that `RR.reset` resets newly created methods.
26
+ [GitHub#8]
27
+
28
+ ## 1.2.0 - 2016-05-30
29
+
30
+ ### Improvements
31
+
32
+ * Renamed RR::Adapters::RRMethods to RR::DSL.
33
+
34
+ * Deprecated RRMethods.
35
+
36
+ * Updated document. [GitHub#57][Patch by Nikolay Shebanov]
37
+
38
+ * Dropped Ruby 1.8 support.
39
+
40
+ * Dropped Ruby 1.9 support.
41
+
42
+ * Dropped Rails 3 support.
43
+
44
+ * Dropped test-unit integration support. Use
45
+ [test-unit-rr](https://test-unit.github.io/#test-unit-rr).
46
+
47
+ * Supported OpenStruct in Ruby 2.3
48
+ [GitHub#64][Reported by soylent][Reported by Arthur Le Maitre]
49
+
50
+ ### Fixes
51
+
52
+ * Fixed using RSpec's RR adapter to not override our RSpec adapter.
53
+ If RR is required and then you use `mock_with :rr` you would not be able to
54
+ use `have_received`.
55
+
56
+ * Fixed a bug that `Hash` argument is too wild.
57
+ [GitHub#54][Reported by Yutaka HARA]
58
+
59
+ * Fixed a bug that `Array` argument is too wild.
60
+ [GitHub#54][Reported by Skye Shaw]
61
+
62
+ ### Thanks
63
+
64
+ * Nikolay Shebanov
65
+
66
+ * Yutaka HARA
67
+
68
+ * Skye Shaw
69
+
70
+ * soylent
71
+
72
+ * Arthur Le Maitre
73
+
74
+ ## 1.1.2 (August 17, 2013)
75
+
76
+ * Add tests, appraisals, etc. back to the published gem ([#32][i32]).
77
+ This is necessary because Debian wraps rr in a package, and they depend on the
78
+ tests to be present in order to run them prior to packaging.
79
+ * Add back RR::Adapters::RSpec2 which was removed accidentally ([#34][i34]).
80
+ This fixes failures when running tests against sham_rack (which is no longer
81
+ using RR, but, oh well).
82
+ * Remove deprecation warning about
83
+ RSpec.configuration.backtrace_clean_patterns under RSpec 2.14 ([#37][i37]).
84
+ NOTE: This warning will continue to appear if you are configuring RSpec using
85
+ `mock_with :rr`. This is because the RR adapter bundled with RSpec still
86
+ refers to `backtrace_clean_patterns` instead of
87
+ `backtrace_exclusion_patterns`. You can either wait until the next release of
88
+ rspec-core, or remove `mock_with :rr` (which is recommended at this point as
89
+ we consider RSpec's adapter to be slightly out of date, and RR provides its
90
+ own adapter for RSpec).
91
+ * RR now officially supports Rails 4.0.0. (It worked before, but now we're
92
+ explicitly testing against it instead of 4.0.0.rc1.)
93
+ * Fix Test::Unit 1 and 2 adapters to avoid a possible "undefined
94
+ Test::Unit::TestCase" error.
95
+ * Prevent adapters from being double-loaded.
96
+ * Including RR::Adapters::TestUnit, RR::Adapters::MiniTest, or
97
+ RR::Adapters::RSpec2 now just re-runs the autohook mechanism instead of
98
+ building a fake adapter, as it was possible to include both a real and fake
99
+ adapter in the same space and they could conflict with each other.
100
+
101
+ ## 1.1.1 (June 17, 2013)
4
102
 
5
103
  * Fix incompatibility issues with Rails 4 ([#26][i26]) and Cucumber
6
104
  ([#29][i29]).
@@ -464,4 +562,7 @@ Issues are re-numbered beginning from 1 from this point on.
464
562
  [i26]: http://github.com/rr/rr/issues/26
465
563
  [i29]: http://github.com/rr/rr/issues/29
466
564
  [i27]: http://github.com/rr/rr/issues/27
565
+ [i34]: http://github.com/rr/rr/issues/34
566
+ [i32]: http://github.com/rr/rr/issues/32
567
+ [i37]: http://github.com/rr/rr/issues/37
467
568
 
data/CREDITS.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Credits
2
2
 
3
+ ## Maintainer
4
+
5
+ * Kouhei Sutou ([@kou](https://github.com/kou))
6
+
7
+
3
8
  ## Authors
4
9
 
5
10
  * Brian Takita ([@btakita](http://github.com/btakita))
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
data/README.md CHANGED
@@ -1,52 +1,16 @@
1
- # RR [![Build Status](https://secure.travis-ci.org/rr/rr.png)](http://travis-ci.org/rr/rr) [![Code Climate GPA](https://codeclimate.com/github/rr/rr.png)](https://codeclimate.com/github/rr/rr)
1
+ # RR [![Gem Version](https://badge.fury.io/rb/rr.svg)](https://badge.fury.io/rb/rr) [![Build Status](https://travis-ci.org/rr/rr.svg?branch=master)](https://travis-ci.org/rr/rr) [![Code Climate GPA](https://codeclimate.com/github/rr/rr.svg)](https://codeclimate.com/github/rr/rr)
2
2
 
3
3
  RR is a test double framework for Ruby that features a rich selection of double
4
4
  techniques and a terse syntax.
5
5
 
6
+ ---
6
7
 
7
- ## Installing RR into your project
8
-
9
- For minimal setup, RR looks for an existing test framework and then hooks itself
10
- into it. Hence, RR works best when loaded *after* the test framework that you
11
- are using is loaded.
12
-
13
- If you are using Bundler, you can achieve this by specifying the dependency on
14
- RR with `require: false`; then, require RR directly following your test
15
- framework.
16
-
17
- Here's what this looks like for different kinds of projects:
18
-
19
- ### Ruby project (without Bundler)
20
-
21
- ~~~ ruby
22
- require 'your/test/framework'
23
- require 'rr'
24
- ~~~
25
-
26
- ### Ruby project (with Bundler)
27
-
28
- ~~~ ruby
29
- # Gemfile
30
- gem 'rr', require: false
31
-
32
- # test helper
33
- require 'your/test/framework'
34
- require 'rr'
35
- ~~~
8
+ ## Learning more
36
9
 
37
- ### Rails project
38
-
39
- ~~~ ruby
40
- # Gemfile
41
- group :test do
42
- gem 'rr', require: false
43
- end
44
-
45
- # test helper
46
- require File.expand_path('../../config/environment', __FILE__)
47
- require 'your/test/framework' # if you are using something other than MiniTest / Test::Unit
48
- require 'rr'
49
- ~~~
10
+ 1. [A whirlwind tour of RR](#a-whirlwind-tour-of-rr)
11
+ 2. [What is a test double?](doc/01_test_double.md)
12
+ 3. [Syntax between RR and other double/mock frameworks](doc/02_syntax_comparison.md)
13
+ 4. [API overview - Full listing of DSL methods](doc/03_api_overview.md)
50
14
 
51
15
 
52
16
  ## A whirlwind tour of RR
@@ -130,107 +94,124 @@ end
130
94
  ~~~
131
95
 
132
96
 
133
- ## Learning more
97
+ ## Installing RR into your project
134
98
 
135
- 1. [What is a test double?](doc/01_test_double.md)
136
- 2. [Syntax between RR and other double/mock frameworks](doc/02_syntax_comparison.md)
137
- 3. [API overview](doc/03_api_overview.md)
99
+ NOTE: If you want to use RR with
100
+ [test-unit](https://test-unit.github.io/), use
101
+ [test-unit-rr](https://test-unit.github.io/#test-unit-rr). You don't
102
+ need to read the following subsections.
138
103
 
104
+ For minimal setup, RR looks for an existing test framework and then hooks itself
105
+ into it. Hence, RR works best when loaded *after* the test framework that you
106
+ are using is loaded.
107
+
108
+ If you are using Bundler, you can achieve this by specifying the dependency on
109
+ RR with `require: false`; then, require RR directly following your test
110
+ framework.
111
+
112
+ Here's what this looks like for different kinds of projects:
113
+
114
+ ### Ruby project (without Bundler)
115
+
116
+ ~~~ ruby
117
+ require 'your/test/framework'
118
+ require 'rr'
119
+ ~~~
120
+
121
+ ### Ruby project (with Bundler)
122
+
123
+ ~~~ ruby
124
+ # Gemfile
125
+ gem 'rr', require: false
126
+
127
+ # test helper
128
+ require 'your/test/framework'
129
+ require 'rr'
130
+ ~~~
131
+
132
+ ### Rails project
133
+
134
+ ~~~ ruby
135
+ # Gemfile
136
+ group :test do
137
+ gem 'rr', require: false
138
+ end
139
+
140
+ # test helper
141
+ require File.expand_path('../../config/environment', __FILE__)
142
+ require 'your/test/framework' # if you are using something other than MiniTest / Test::Unit
143
+ require 'rr'
144
+ ~~~
145
+
146
+ ## Compatibility
147
+
148
+ RR is designed and tested to work against the following Ruby versions:
149
+
150
+ * 2.4
151
+ * 2.5
152
+ * 2.6
153
+ * 2.7
154
+ * JRuby 1.7.4
155
+
156
+ as well as the following test frameworks:
157
+
158
+ * Test::Unit via [test-unit-rr](https://test-unit.github.io/#test-unit-rr)
159
+ * RSpec 2
160
+ * MiniTest 4
161
+ * Minitest 5
139
162
 
140
163
  ## Help!
141
164
 
142
- While I may add one later, RR does not have a mailing list at this time, so if
143
- you have a question simply [post it as an issue](http://github.com/rr/rr/issues)
144
- and I'll respond as soon as I can.
165
+ If you have a question or are having trouble, simply [post it as an
166
+ issue](https://github.com/rr/rr/issues) and I'll respond as soon as I can.
145
167
 
146
168
 
147
169
  ## Contributing
148
170
 
149
- Want to contribute a bugfix or new feature to RR? Great! Follow these steps:
171
+ Want to contribute a bug fix or new feature to RR? Great! Follow these steps:
150
172
 
151
- 1. If you haven't already, install Ruby 2.0.0-p0 (this is the primary Ruby
152
- version that RR targets).
173
+ 1. Make sure you have a recent Ruby (check the compatibility table above).
153
174
  2. Clone the repo (you probably knew that already).
154
175
  3. Make a new branch off of `master` with a descriptive name.
155
- 4. Work on your bugfix or feature.
176
+ 4. Work on your patch.
156
177
  5. Run `bundle install`.
157
178
  6. Ensure all of the tests pass by running `bundle exec rake`.
158
179
  7. If you want to go the extra mile, install the other Ruby versions listed
159
- below in the compatibility table, and repeat steps 5-6. See the "Running test
180
+ above in the compatibility table, and repeat steps 5-6. See the "Running test
160
181
  suites" section below for more information.
161
- 8. When you're done, come back to this repo and create a pull request from your
162
- branch. I'll respond as soon as I can.
182
+ 8. When you're done, push your branch and create a pull request from it.
183
+ I'll respond as soon as I can.
163
184
 
164
- ### Running test suites
185
+ ### Running tests
165
186
 
166
- In order to test support for multiple Ruby versions and environments, there are
167
- multiple test suites, and Rake tasks to run these suites. The list of available
168
- Rake tasks depends on which version of Ruby you are under, but you can get the
169
- full list with:
187
+ As indicated by the compatibility list above, in order to test support for
188
+ multiple Ruby versions and environments, there are multiple test suites, and
189
+ Rake tasks to run these suites. The list of available Rake tasks depends on
190
+ which version of Ruby you are under, but you can get the full list with:
170
191
 
171
- rake -D spec:
192
+ bundle exec rake -D spec:
172
193
 
173
194
  To run all the suites, simply say:
174
195
 
175
- rake
196
+ bundle exec rake
176
197
 
177
198
  (Incidentally, this is also the command which Travis runs.)
178
199
 
179
- Finally, to aid development only, if you're using rbenv, you can run all of the
180
- tests on all of the Rubies easily with:
181
-
182
- script/run_full_test_suite
183
-
184
- This requires that you have the
185
- [rbenv-only](https://github.com/rodreegez/rbenv-only) plugin installed, and of
186
- course, the necessary Rubies as well too.
187
-
188
-
189
- ## Compatibility
190
-
191
- RR is designed and tested to work against the following test frameworks and
192
- Ruby/Rails versions:
193
-
194
- | | Ruby 1.8.7-p371 | Ruby 1.9.3-p392 | Ruby 2.0.0-p0 | JRuby 1.7.3 (1.9 mode) |
195
- |-----------------------|:---------------:|:---------------:|:-------------:|:----------------------:|
196
- | MiniTest 4.x | | ✓ | ✓ | ✓ |
197
- | MiniTest 4.x + Rails 3 | | ✓ | ✓ | ✓ |
198
- | MiniTest 4.x + Rails 4.0.0.rc1 | | ✓ | ✓ | ✓ |
199
- | Minitest 5.x | | ✓ | ✓ | ✓ |
200
- | Minitest 5.x + Rails 3 | | ✓ | ✓ | ✓ |
201
- | Test::Unit 1 | ✓ | | | |
202
- | Test::Unit 1 + Rails 2.x | ✓ | | | |
203
- | Test::Unit 2.0.0 | | ✓ | ✓ | ✓ |
204
- | Test::Unit 2.0.0 + Rails 3.x | | ✓ | ✓ | ✓ |
205
- | Test::Unit 2.0.0 + Rails 4.0.0.rc1 | | ✓ | ✓ | ✓ |
206
- | Test::Unit 2.4.x | ✓ | | | |
207
- | Test::Unit 2.4.x + Rails 2.x | ✓ | | | |
208
- | Test::Unit ~> 2.5 | | ✓ | ✓ | ✓ |
209
- | Test::Unit ~> 2.5 + Rails 3.x | | ✓ | ✓ | ✓ |
210
- | Test::Unit ~> 2.5 + Rails 4.0.0.rc1 | | ✓ | ✓ | ✓ |
211
- | RSpec 1.x | ✓ | | | |
212
- | RSpec 1.x + Rails 2.x | ✓ | | | |
213
- | RSpec 2.x | | ✓ | ✓ | ✓ |
214
- | RSpec 2.x + Rails 3.x | | ✓ | ✓ | ✓ |
215
- | RSpec 2.x + Rails 4.0.0.rc1 | | ✓ | ✓ | ✓ |
216
-
217
200
 
218
201
  ## Author/Contact
219
202
 
220
- RR was originally written by Brian Takita. It is currently maintained by Elliot
221
- Winkler (<elliot.winkler@gmail.com>).
203
+ RR was originally written by Brian Takita. And it was maintained by
204
+ Elliot Winkler (<elliot.winkler@gmail.com>). It is currently
205
+ maintained by Kouhei Sutou (<kou@cozmixng.org>).
222
206
 
223
207
 
224
208
  ## Credits
225
209
 
226
210
  With any development effort, there are countless people who have contributed to
227
- making it possible. We all are standing on the shoulders of giants! [You can
228
- read all the credits here](CREDITS.md). (Incidentally, if you've directly
229
- contributed to RR and I haven't included you in this list, please let me know.
230
- Thanks!)
211
+ making it possible; RR is no exception! [You can read the full list of
212
+ credits here](CREDITS.md).
231
213
 
232
214
 
233
215
  ## License
234
216
 
235
- RR is available under the MIT license. Read [LICENSE](LICENSE) for the full
236
- scoop.
217
+ RR is available under the [MIT license](LICENSE).
data/Rakefile ADDED
@@ -0,0 +1,43 @@
1
+ require 'rubygems'
2
+ require 'bundler'
3
+ require 'rake'
4
+
5
+ require 'pp'
6
+
7
+ # build, install, release
8
+ require 'bundler/gem_tasks'
9
+
10
+ default_tasks = []
11
+
12
+ begin
13
+ # appraisal
14
+ require 'appraisal'
15
+ rescue LoadError
16
+ else
17
+ # appraisals
18
+ Appraisal::File.each do |appraisal|
19
+ desc "Resolve and install dependencies for the #{appraisal.name} appraisal"
20
+ task "appraisal:#{appraisal.name}:install" do
21
+ appraisal.install
22
+ end
23
+ end
24
+ default_tasks << 'appraisal:install'
25
+ end
26
+
27
+ begin
28
+ # spec
29
+ require 'rspec/core/rake_task'
30
+ rescue LoadError
31
+ else
32
+ require File.expand_path('../spec/defines_spec_suite_tasks', __FILE__)
33
+ DefinesSpecSuiteTasks.call
34
+ default_tasks << :spec
35
+ end
36
+
37
+ desc "Run tests"
38
+ task :test do
39
+ ruby("test/run-test.rb")
40
+ end
41
+ default_tasks << :test
42
+
43
+ task :default => default_tasks
@@ -94,3 +94,4 @@ my_object.should_receive(:hello).with('bob', 'jane').and_return('Hello Bob and J
94
94
  # RR
95
95
  mock(my_object).hello('bob', 'jane') { 'Hello Bob and Jane' }
96
96
  mock(my_object).hello('bob', 'jane').returns('Hello Bob and Jane') # same thing, just more verbose
97
+ ~~~