rr 1.1.1 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Appraisals +6 -0
- data/CHANGES.md +102 -1
- data/CREDITS.md +5 -0
- data/Gemfile +3 -0
- data/README.md +91 -110
- data/Rakefile +43 -0
- data/doc/02_syntax_comparison.md +1 -0
- data/gemfiles/ruby_19_rspec_2.gemfile +14 -0
- data/gemfiles/ruby_19_rspec_2.gemfile.lock +49 -0
- data/gemfiles/ruby_19_rspec_2_rails_4.gemfile +15 -0
- data/gemfiles/ruby_19_rspec_2_rails_4.gemfile.lock +119 -0
- data/lib/rr/class_instance_method_defined.rb +1 -1
- data/lib/rr/core_ext/array.rb +2 -0
- data/lib/rr/core_ext/hash.rb +2 -0
- data/lib/rr/deprecations.rb +97 -0
- data/lib/rr/double.rb +28 -10
- data/lib/rr/double_definitions/double_definition.rb +39 -16
- data/lib/rr/double_definitions/double_definition_create.rb +5 -5
- data/lib/rr/double_definitions/double_definition_create_blank_slate.rb +10 -4
- data/lib/rr/double_definitions/double_injections/any_instance_of.rb +1 -1
- data/lib/rr/double_definitions/double_injections/instance.rb +2 -2
- data/lib/rr/double_definitions/strategies/strategy.rb +27 -8
- data/lib/rr/double_definitions/strategies/verification/mock.rb +8 -2
- data/lib/rr/double_matches.rb +4 -3
- data/lib/rr/dsl.rb +152 -0
- data/lib/rr/expectations/any_argument_expectation.rb +4 -4
- data/lib/rr/expectations/argument_equality_expectation.rb +43 -5
- data/lib/rr/injections/double_injection.rb +67 -19
- data/lib/rr/injections/method_missing_injection.rb +37 -6
- data/lib/rr/integrations.rb +13 -12
- data/lib/rr/integrations/decorator.rb +4 -1
- data/lib/rr/integrations/minitest_4.rb +1 -1
- data/lib/rr/integrations/minitest_4_active_support.rb +1 -1
- data/lib/rr/integrations/rspec/invocation_matcher.rb +0 -8
- data/lib/rr/integrations/rspec_2.rb +28 -3
- data/lib/rr/keyword_arguments.rb +15 -0
- data/lib/rr/method_dispatches/base_method_dispatch.rb +22 -5
- data/lib/rr/method_dispatches/method_dispatch.rb +21 -10
- data/lib/rr/method_dispatches/method_missing_dispatch.rb +14 -5
- data/lib/rr/recorded_call.rb +35 -0
- data/lib/rr/recorded_calls.rb +23 -9
- data/lib/rr/space.rb +15 -5
- data/lib/rr/spy_verification.rb +13 -5
- data/lib/rr/version.rb +1 -2
- data/lib/rr/wildcard_matchers.rb +10 -10
- data/lib/rr/without_autohook.rb +7 -14
- data/rr.gemspec +14 -5
- data/spec/custom_formatter_for_rspec.rb +18 -0
- data/spec/custom_formatter_for_rspec_2.rb +40 -0
- data/spec/defines_spec_suite_tasks.rb +57 -0
- data/spec/fixtures/rubygems_patch_for_187.rb +598 -0
- data/spec/global_helper.rb +38 -0
- data/spec/spec.opts +3 -0
- data/spec/spec_suite_configuration.rb +126 -0
- data/spec/spec_suite_runner.rb +47 -0
- data/spec/suites.yml +10 -0
- data/spec/suites/rspec_2/functional/any_instance_of_spec.rb +147 -0
- data/spec/suites/rspec_2/functional/dont_allow_spec.rb +17 -0
- data/spec/suites/rspec_2/functional/mock_bang_spec.rb +20 -0
- data/spec/suites/rspec_2/functional/mock_instance_of_spec.rb +14 -0
- data/spec/suites/rspec_2/functional/mock_instance_of_strong_spec.rb +15 -0
- data/spec/suites/rspec_2/functional/mock_proxy_instance_of_spec.rb +15 -0
- data/spec/suites/rspec_2/functional/mock_proxy_spec.rb +14 -0
- data/spec/suites/rspec_2/functional/mock_spec.rb +17 -0
- data/spec/suites/rspec_2/functional/mock_strong_spec.rb +14 -0
- data/spec/suites/rspec_2/functional/received_spec.rb +16 -0
- data/spec/suites/rspec_2/functional/spy_spec.rb +102 -0
- data/spec/suites/rspec_2/functional/stub_bang_spec.rb +20 -0
- data/spec/suites/rspec_2/functional/stub_instance_of_spec.rb +15 -0
- data/spec/suites/rspec_2/functional/stub_instance_of_strong_spec.rb +15 -0
- data/spec/suites/rspec_2/functional/stub_proxy_instance_of_spec.rb +16 -0
- data/spec/suites/rspec_2/functional/stub_proxy_spec.rb +45 -0
- data/spec/suites/rspec_2/functional/stub_spec.rb +71 -0
- data/spec/suites/rspec_2/functional/stub_strong_spec.rb +15 -0
- data/spec/suites/rspec_2/functional/wildcard_matchers_spec.rb +128 -0
- data/spec/suites/rspec_2/helper.rb +28 -0
- data/spec/suites/rspec_2/integration/minitest_4_spec.rb +109 -0
- data/spec/suites/rspec_2/integration/minitest_spec.rb +109 -0
- data/spec/suites/rspec_2/spec_helper.rb +3 -0
- data/spec/suites/rspec_2/support/matchers/wildcard_matcher_matchers.rb +32 -0
- data/spec/suites/rspec_2/support/mixins/double_definition_creator_helpers.rb +173 -0
- data/spec/suites/rspec_2/support/mixins/mock_definition_creator_helpers.rb +45 -0
- data/spec/suites/rspec_2/support/mixins/proxy_definition_creator_helpers.rb +33 -0
- data/spec/suites/rspec_2/support/mixins/stub_creator_helpers.rb +43 -0
- data/spec/suites/rspec_2/support/mixins/stub_definition_creator_helpers.rb +45 -0
- data/spec/suites/rspec_2/support/shared_contexts/double_definition_creators/argument_expectations_with_never_called_qualifier.rb +39 -0
- data/spec/suites/rspec_2/support/shared_contexts/double_definition_creators/argument_expectations_with_times_called_qualifier.rb +50 -0
- data/spec/suites/rspec_2/support/shared_contexts/double_definition_creators/argument_expectations_without_qualifiers.rb +131 -0
- data/spec/suites/rspec_2/support/shared_contexts/double_definition_creators/dont_allow.rb +148 -0
- data/spec/suites/rspec_2/support/shared_contexts/double_definition_creators/mock_instance_of.rb +26 -0
- data/spec/suites/rspec_2/support/shared_contexts/double_definition_creators/mock_instance_of_strong.rb +28 -0
- data/spec/suites/rspec_2/support/shared_contexts/double_definition_creators/mock_proxy.rb +11 -0
- data/spec/suites/rspec_2/support/shared_contexts/double_definition_creators/mock_strong.rb +37 -0
- data/spec/suites/rspec_2/support/shared_contexts/double_definition_creators/mocking.rb +107 -0
- data/spec/suites/rspec_2/support/shared_contexts/double_definition_creators/stub_instance_of.rb +32 -0
- data/spec/suites/rspec_2/support/shared_contexts/double_definition_creators/stub_instance_of_strong.rb +39 -0
- data/spec/suites/rspec_2/support/shared_contexts/double_definition_creators/stub_proxy.rb +11 -0
- data/spec/suites/rspec_2/support/shared_contexts/double_definition_creators/stub_strong.rb +37 -0
- data/spec/suites/rspec_2/support/shared_contexts/double_definition_creators/stubbing.rb +57 -0
- data/spec/suites/rspec_2/support/shared_examples/double_definition_creators/array_flatten_bug.rb +35 -0
- data/spec/suites/rspec_2/support/shared_examples/double_definition_creators/block_form.rb +31 -0
- data/spec/suites/rspec_2/support/shared_examples/double_definition_creators/comparing_arity.rb +63 -0
- data/spec/suites/rspec_2/support/shared_examples/double_definition_creators/object_is_proxy.rb +43 -0
- data/spec/suites/rspec_2/support/shared_examples/double_definition_creators/sequential_invocations.rb +26 -0
- data/spec/suites/rspec_2/support/shared_examples/double_definition_creators/setting_implementation.rb +51 -0
- data/spec/suites/rspec_2/support/shared_examples/double_definition_creators/yields.rb +81 -0
- data/spec/suites/rspec_2/support/shared_examples/space.rb +13 -0
- data/spec/suites/rspec_2/support/shared_examples/times_called_expectation.rb +9 -0
- data/spec/suites/rspec_2/unit/core_ext/array_spec.rb +39 -0
- data/spec/suites/rspec_2/unit/core_ext/enumerable_spec.rb +53 -0
- data/spec/suites/rspec_2/unit/core_ext/hash_spec.rb +55 -0
- data/spec/suites/rspec_2/unit/core_ext/range_spec.rb +41 -0
- data/spec/suites/rspec_2/unit/core_ext/regexp_spec.rb +41 -0
- data/spec/suites/rspec_2/unit/deprecations_spec.rb +27 -0
- data/spec/suites/rspec_2/unit/double_definitions/child_double_definition_create_spec.rb +114 -0
- data/spec/suites/rspec_2/unit/double_definitions/double_definition_create_blank_slate_spec.rb +93 -0
- data/spec/suites/rspec_2/unit/double_definitions/double_definition_create_spec.rb +446 -0
- data/spec/suites/rspec_2/unit/dsl/double_creators_spec.rb +133 -0
- data/spec/suites/rspec_2/unit/dsl/space_spec.rb +99 -0
- data/spec/suites/rspec_2/unit/dsl/wildcard_matchers_spec.rb +67 -0
- data/spec/suites/rspec_2/unit/errors/rr_error_spec.rb +67 -0
- data/spec/suites/rspec_2/unit/expectations/any_argument_expectation_spec.rb +48 -0
- data/spec/suites/rspec_2/unit/expectations/anything_argument_equality_expectation_spec.rb +14 -0
- data/spec/suites/rspec_2/unit/expectations/argument_equality_expectation_spec.rb +135 -0
- data/spec/suites/rspec_2/unit/expectations/boolean_argument_equality_expectation_spec.rb +30 -0
- data/spec/suites/rspec_2/unit/expectations/hash_including_argument_equality_expectation_spec.rb +92 -0
- data/spec/suites/rspec_2/unit/expectations/satisfy_argument_equality_expectation_spec.rb +61 -0
- data/spec/suites/rspec_2/unit/expectations/times_called_expectation/any_times_matcher_spec.rb +22 -0
- data/spec/suites/rspec_2/unit/expectations/times_called_expectation/at_least_matcher_spec.rb +37 -0
- data/spec/suites/rspec_2/unit/expectations/times_called_expectation/at_most_matcher_spec.rb +43 -0
- data/spec/suites/rspec_2/unit/expectations/times_called_expectation/integer_matcher_spec.rb +58 -0
- data/spec/suites/rspec_2/unit/expectations/times_called_expectation/proc_matcher_spec.rb +35 -0
- data/spec/suites/rspec_2/unit/expectations/times_called_expectation/range_matcher_spec.rb +39 -0
- data/spec/suites/rspec_2/unit/hash_with_object_id_key_spec.rb +88 -0
- data/spec/suites/rspec_2/unit/injections/double_injection/double_injection_spec.rb +533 -0
- data/spec/suites/rspec_2/unit/injections/double_injection/double_injection_verify_spec.rb +32 -0
- data/spec/suites/rspec_2/unit/integrations/rspec/invocation_matcher_spec.rb +297 -0
- data/spec/suites/rspec_2/unit/integrations/rspec_spec.rb +70 -0
- data/spec/suites/rspec_2/unit/rr_spec.rb +28 -0
- data/spec/suites/rspec_2/unit/space_spec.rb +598 -0
- data/spec/suites/rspec_2/unit/spy_verification_spec.rb +133 -0
- data/spec/suites/rspec_2/unit/times_called_matchers/any_times_matcher_spec.rb +46 -0
- data/spec/suites/rspec_2/unit/times_called_matchers/at_least_matcher_spec.rb +54 -0
- data/spec/suites/rspec_2/unit/times_called_matchers/at_most_matcher_spec.rb +69 -0
- data/spec/suites/rspec_2/unit/times_called_matchers/integer_matcher_spec.rb +69 -0
- data/spec/suites/rspec_2/unit/times_called_matchers/proc_matcher_spec.rb +54 -0
- data/spec/suites/rspec_2/unit/times_called_matchers/range_matcher_spec.rb +75 -0
- data/spec/suites/rspec_2/unit/times_called_matchers/times_called_matcher_spec.rb +117 -0
- data/spec/suites/rspec_2/unit/wildcard_matchers/anything_spec.rb +33 -0
- data/spec/suites/rspec_2/unit/wildcard_matchers/boolean_spec.rb +45 -0
- data/spec/suites/rspec_2/unit/wildcard_matchers/duck_type_spec.rb +64 -0
- data/spec/suites/rspec_2/unit/wildcard_matchers/hash_including_spec.rb +64 -0
- data/spec/suites/rspec_2/unit/wildcard_matchers/is_a_spec.rb +55 -0
- data/spec/suites/rspec_2/unit/wildcard_matchers/numeric_spec.rb +46 -0
- data/spec/suites/rspec_2/unit/wildcard_matchers/satisfy_spec.rb +57 -0
- data/spec/support/adapter.rb +22 -0
- data/spec/support/adapter_tests/base.rb +45 -0
- data/spec/support/adapter_tests/minitest.rb +7 -0
- data/spec/support/adapter_tests/rspec.rb +70 -0
- data/spec/support/adapter_tests/test_unit.rb +47 -0
- data/spec/support/command_runner.rb +105 -0
- data/spec/support/generator.rb +56 -0
- data/spec/support/integration_tests/base.rb +64 -0
- data/spec/support/integration_tests/rails.rb +60 -0
- data/spec/support/integration_tests/rails_minitest.rb +13 -0
- data/spec/support/integration_tests/rails_rspec.rb +13 -0
- data/spec/support/integration_tests/rails_test_unit.rb +13 -0
- data/spec/support/integration_tests/rails_test_unit_like.rb +13 -0
- data/spec/support/integration_tests/ruby.rb +7 -0
- data/spec/support/integration_tests/ruby_minitest.rb +13 -0
- data/spec/support/integration_tests/ruby_rspec.rb +13 -0
- data/spec/support/integration_tests/ruby_test_unit.rb +13 -0
- data/spec/support/matchers/be_a_subset_of_matcher.rb +24 -0
- data/spec/support/project/cucumber.rb +50 -0
- data/spec/support/project/generator.rb +348 -0
- data/spec/support/project/minitest.rb +39 -0
- data/spec/support/project/rails.rb +199 -0
- data/spec/support/project/rails_minitest.rb +17 -0
- data/spec/support/project/rails_rspec.rb +50 -0
- data/spec/support/project/rails_test_unit.rb +17 -0
- data/spec/support/project/rails_test_unit_like.rb +17 -0
- data/spec/support/project/rspec.rb +69 -0
- data/spec/support/project/ruby.rb +34 -0
- data/spec/support/project/ruby_minitest.rb +11 -0
- data/spec/support/project/ruby_rspec.rb +29 -0
- data/spec/support/project/ruby_test_unit.rb +11 -0
- data/spec/support/project/ruby_test_unit_like.rb +21 -0
- data/spec/support/project/test_unit.rb +29 -0
- data/spec/support/project/test_unit_like.rb +7 -0
- data/spec/support/project/tests_runner.rb +22 -0
- data/spec/support/test.sqlite3 +0 -0
- data/spec/support/test_case/generator.rb +53 -0
- data/spec/support/test_case/minitest.rb +13 -0
- data/spec/support/test_case/rspec.rb +19 -0
- data/spec/support/test_case/test_unit.rb +21 -0
- data/spec/support/test_file/generator.rb +120 -0
- data/spec/support/test_file/minitest.rb +19 -0
- data/spec/support/test_file/rails_minitest.rb +7 -0
- data/spec/support/test_file/rails_rspec.rb +12 -0
- data/spec/support/test_file/rails_test_unit.rb +25 -0
- data/spec/support/test_file/rspec.rb +33 -0
- data/spec/support/test_file/test_unit.rb +36 -0
- data/spec/support/test_helper/generator.rb +27 -0
- data/spec/support/test_helper/minitest.rb +7 -0
- data/spec/support/test_helper/rails.rb +31 -0
- data/spec/support/test_helper/rails_minitest.rb +7 -0
- data/spec/support/test_helper/rails_rspec.rb +25 -0
- data/spec/support/test_helper/rails_test_unit.rb +23 -0
- data/spec/support/test_helper/rspec.rb +7 -0
- data/spec/support/test_helper/ruby.rb +31 -0
- data/spec/support/test_helper/test_unit.rb +7 -0
- metadata +240 -19
- data/VERSION +0 -1
- data/lib/rr/adapters.rb +0 -44
- data/lib/rr/adapters/rr_methods.rb +0 -142
- data/lib/rr/integrations/rspec_1.rb +0 -46
- data/lib/rr/integrations/test_unit_1.rb +0 -63
- data/lib/rr/integrations/test_unit_2.rb +0 -15
- data/lib/rr/integrations/test_unit_200.rb +0 -27
- data/lib/rr/integrations/test_unit_200_active_support.rb +0 -25
- data/lib/rr/integrations/test_unit_2_active_support.rb +0 -38
- data/lib/rr/proc_from_block.rb +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: a67997dc1e6efa65e6b99101306915242163d3d6b65f73cec7a1ba2e3dbb3229
|
4
|
+
data.tar.gz: 34ed2995cdf97291cb5f1334737d8fc93dbd9078a420197635a307414d61255c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0bb271fe1108d5b1fc1b35c8c14d1d38bcf2254e9863a7cc48d8e20ca67aabc3ee6d02e8cb9bcd30875c285a3b5c14e3386faa31b7907f04be501678025a5278
|
7
|
+
data.tar.gz: 85641d68043365de3f062ef34164492ba69c5be725b14a12eef75f06895df73a05dbea3d53d196e6f3402d1f4ce108bcc2bdc2b8c65e2bfb015d2f7d7f6bff7c
|
data/Appraisals
ADDED
data/CHANGES.md
CHANGED
@@ -1,6 +1,104 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
-
##
|
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
data/Gemfile
ADDED
data/README.md
CHANGED
@@ -1,52 +1,16 @@
|
|
1
|
-
# RR [![Build Status](https://
|
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
|
-
##
|
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
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
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
|
-
##
|
97
|
+
## Installing RR into your project
|
134
98
|
|
135
|
-
|
136
|
-
|
137
|
-
|
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
|
-
|
143
|
-
|
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
|
171
|
+
Want to contribute a bug fix or new feature to RR? Great! Follow these steps:
|
150
172
|
|
151
|
-
1.
|
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
|
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
|
-
|
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,
|
162
|
-
|
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
|
185
|
+
### Running tests
|
165
186
|
|
166
|
-
|
167
|
-
multiple
|
168
|
-
Rake tasks
|
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.
|
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
|
228
|
-
|
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
|
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
|
data/doc/02_syntax_comparison.md
CHANGED