rr 1.1.1 → 1.1.2.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Appraisals +46 -0
- data/CHANGES.md +21 -1
- data/Gemfile +19 -0
- data/README.md +91 -106
- data/Rakefile +55 -0
- data/gemfiles/ruby_18_rspec_1.gemfile +14 -0
- data/gemfiles/ruby_18_rspec_1.gemfile.lock +38 -0
- data/gemfiles/ruby_18_rspec_1_rails_2.gemfile +18 -0
- data/gemfiles/ruby_18_rspec_1_rails_2.gemfile.lock +64 -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_3.gemfile +15 -0
- data/gemfiles/ruby_19_rspec_2_rails_3.gemfile.lock +123 -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/adapters.rb +4 -14
- data/lib/rr/integrations.rb +13 -12
- data/lib/rr/integrations/decorator.rb +4 -1
- data/lib/rr/integrations/rspec_2.rb +6 -1
- data/lib/rr/integrations/test_unit_1.rb +2 -2
- data/lib/rr/integrations/test_unit_2.rb +3 -1
- data/lib/rr/version.rb +1 -2
- data/lib/rr/without_autohook.rb +1 -1
- data/rr.gemspec +6 -2
- 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 +45 -0
- data/spec/fixtures/rubygems_patch_for_187.rb +598 -0
- data/spec/global_helper.rb +33 -0
- data/spec/spec.opts +3 -0
- data/spec/spec_suite_configuration.rb +132 -0
- data/spec/spec_suite_runner.rb +47 -0
- data/spec/suites.yml +24 -0
- data/spec/suites/rspec_1/helper.rb +24 -0
- data/spec/suites/rspec_1/integration/rspec_1_spec.rb +93 -0
- data/spec/suites/rspec_1/integration/test_unit_1_spec.rb +102 -0
- data/spec/suites/rspec_1/integration/test_unit_2_spec.rb +109 -0
- data/spec/suites/rspec_1/spec_helper.rb +3 -0
- data/spec/suites/rspec_1_rails_2/integration/astc_rails_2_spec.rb +141 -0
- data/spec/suites/rspec_1_rails_2/integration/rspec_1_rails_2_spec.rb +132 -0
- data/spec/suites/rspec_1_rails_2/integration/test_unit_1_rails_2_spec.rb +141 -0
- data/spec/suites/rspec_1_rails_2/integration/test_unit_2_rails_2_spec.rb +148 -0
- data/spec/suites/rspec_1_rails_2/spec_helper.rb +3 -0
- data/spec/suites/rspec_2/functional/any_instance_of_spec.rb +47 -0
- data/spec/suites/rspec_2/functional/dont_allow_spec.rb +12 -0
- data/spec/suites/rspec_2/functional/dsl_spec.rb +13 -0
- data/spec/suites/rspec_2/functional/instance_of_spec.rb +14 -0
- data/spec/suites/rspec_2/functional/mock_spec.rb +241 -0
- data/spec/suites/rspec_2/functional/proxy_spec.rb +136 -0
- data/spec/suites/rspec_2/functional/spy_spec.rb +41 -0
- data/spec/suites/rspec_2/functional/strong_spec.rb +79 -0
- data/spec/suites/rspec_2/functional/stub_spec.rb +190 -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/integration/rspec_2_spec.rb +133 -0
- data/spec/suites/rspec_2/integration/test_unit_200_spec.rb +102 -0
- data/spec/suites/rspec_2/integration/test_unit_2_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/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/adapters/rr_methods/double_creators_spec.rb +135 -0
- data/spec/suites/rspec_2/unit/adapters/rr_methods/space_spec.rb +101 -0
- data/spec/suites/rspec_2/unit/adapters/rr_methods/wildcard_matchers_spec.rb +69 -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 +81 -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/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/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 +82 -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 +545 -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 +85 -0
- data/spec/suites/rspec_2/unit/proc_from_block_spec.rb +14 -0
- data/spec/suites/rspec_2/unit/rr_spec.rb +28 -0
- data/spec/suites/rspec_2/unit/space_spec.rb +595 -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/suites/rspec_2_rails_3/integration/astc_rails_3_spec.rb +141 -0
- data/spec/suites/rspec_2_rails_3/integration/minitest_4_rails_3_spec.rb +148 -0
- data/spec/suites/rspec_2_rails_3/integration/rspec_2_rails_3_spec.rb +172 -0
- data/spec/suites/rspec_2_rails_3/integration/test_unit_200_rails_3_spec.rb +141 -0
- data/spec/suites/rspec_2_rails_3/integration/test_unit_2_rails_3_spec.rb +148 -0
- data/spec/suites/rspec_2_rails_3/spec_helper.rb +3 -0
- data/spec/suites/rspec_2_rails_4/integration/astc_rails_4_spec.rb +142 -0
- data/spec/suites/rspec_2_rails_4/integration/minitest_4_rails_4_spec.rb +149 -0
- data/spec/suites/rspec_2_rails_4/integration/rspec_2_rails_4_spec.rb +173 -0
- data/spec/suites/rspec_2_rails_4/integration/test_unit_200_rails_4_spec.rb +142 -0
- data/spec/suites/rspec_2_rails_4/integration/test_unit_2_rails_4_spec.rb +149 -0
- data/spec/suites/rspec_2_rails_4/spec_helper.rb +3 -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 +66 -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 +352 -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 +172 -6
- data/VERSION +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fcd365900d797d064358a2e5971e188181dcac4f
|
4
|
+
data.tar.gz: 76b4b3f175b477d1ef4978d3c6c29dfec6240eb2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f961d11097a46ec5be81dd0c06081a599e974523da84129d095a40ce255d21d2b24390919ee02070f75a429f0febbe9380648839d8f39355f12dc1542271adf
|
7
|
+
data.tar.gz: a694d5160568ac9878482257f22f42493bc62db670feb5b20ca7ec15669072519916235cb5aa0b69a026e88de30c1479148918d73dc0572ad333e0777f224bc3
|
data/Appraisals
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
ruby_18_stuff = proc do
|
2
|
+
ruby_18_rails_2 = proc do
|
3
|
+
gem 'rails', '~> 2.3'
|
4
|
+
gem 'mocha', '~> 0.12.0'
|
5
|
+
gem 'sqlite3', '~> 1.3', :platforms => :ruby
|
6
|
+
gem 'activerecord-jdbcsqlite3-adapter', :platforms => :jruby
|
7
|
+
end
|
8
|
+
|
9
|
+
#---
|
10
|
+
|
11
|
+
appraise 'ruby_18_rspec_1' do
|
12
|
+
end
|
13
|
+
|
14
|
+
appraise 'ruby_18_rspec_1_rails_2' do
|
15
|
+
instance_eval &ruby_18_rails_2
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
ruby_19_stuff = proc do
|
20
|
+
ruby_19_rails_3 = proc do
|
21
|
+
gem 'rails', '~> 3.0'
|
22
|
+
end
|
23
|
+
|
24
|
+
ruby_19_rails_4 = proc do
|
25
|
+
gem 'rails', '4.0.0'
|
26
|
+
end
|
27
|
+
|
28
|
+
#---
|
29
|
+
|
30
|
+
appraise 'ruby_19_rspec_2' do
|
31
|
+
end
|
32
|
+
|
33
|
+
appraise 'ruby_19_rspec_2_rails_3' do
|
34
|
+
instance_eval &ruby_19_rails_3
|
35
|
+
end
|
36
|
+
|
37
|
+
appraise 'ruby_19_rspec_2_rails_4' do
|
38
|
+
instance_eval &ruby_19_rails_4
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
if RUBY_VERSION =~ /^1\.8/
|
43
|
+
instance_eval &ruby_18_stuff
|
44
|
+
else
|
45
|
+
instance_eval &ruby_19_stuff
|
46
|
+
end
|
data/CHANGES.md
CHANGED
@@ -1,6 +1,23 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
-
##
|
3
|
+
## HEAD
|
4
|
+
|
5
|
+
* Add back tests, appraisals, etc. to the published gem ([#32][i32]).
|
6
|
+
This is necessary because Debian wraps rr in a package, and they depend on the
|
7
|
+
tests to be present in order to run them prior to packaging.
|
8
|
+
* Add back RR::Adapters::RSpec2 which was removed accidentally ([#34][i34]).
|
9
|
+
This fixes failures when running tests against sham_rack.
|
10
|
+
* Remove deprecation warning about
|
11
|
+
RSpec.configuration.backtrace_clean_patterns under RSpec 2.14 ([#37][i37]).
|
12
|
+
* Bump integration tests from Rails 4.0.0.rc1 to 4.0.0.
|
13
|
+
* Fix Test::Unit 1 and 2 adapters to avoid a possible "undefined
|
14
|
+
Test::Unit::TestCase" error.
|
15
|
+
* Including RR::Adapters::TestUnit, RR::Adapters::MiniTest, or
|
16
|
+
RR::Adapters::RSpec2 now just re-runs the autohook mechanism instead of
|
17
|
+
building a fake adapter.
|
18
|
+
* Prevent adapters from being double-loaded.
|
19
|
+
|
20
|
+
## 1.1.1 (June 17, 2013)
|
4
21
|
|
5
22
|
* Fix incompatibility issues with Rails 4 ([#26][i26]) and Cucumber
|
6
23
|
([#29][i29]).
|
@@ -464,4 +481,7 @@ Issues are re-numbered beginning from 1 from this point on.
|
|
464
481
|
[i26]: http://github.com/rr/rr/issues/26
|
465
482
|
[i29]: http://github.com/rr/rr/issues/29
|
466
483
|
[i27]: http://github.com/rr/rr/issues/27
|
484
|
+
[i34]: http://github.com/rr/rr/issues/34
|
485
|
+
[i32]: http://github.com/rr/rr/issues/32
|
486
|
+
[i37]: http://github.com/rr/rr/issues/37
|
467
487
|
|
data/Gemfile
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
gem 'rake', '~> 10.0'
|
4
|
+
gem 'aws-sdk', '~> 1.0'
|
5
|
+
gem 'minitar', '~> 0.5'
|
6
|
+
gem 'dotenv', '~> 0.7'
|
7
|
+
gem 'simplecov', '~> 0.7'
|
8
|
+
gem 'appraisal', '~> 0.5'
|
9
|
+
gem 'posix-spawn', :platforms => :mri
|
10
|
+
gem 'open4', :platforms => :mri
|
11
|
+
|
12
|
+
# Put this here instead of in Appraisals so that when running a single test file
|
13
|
+
# in development we can say `rspec ...` or `spec ...` instead of having to
|
14
|
+
# prepend it with BUNDLE_GEMFILE=...
|
15
|
+
if RUBY_VERSION =~ /^1\.8/
|
16
|
+
gem 'rspec', '~> 1.3'
|
17
|
+
else
|
18
|
+
gem 'rspec', '~> 2.14'
|
19
|
+
end
|
data/README.md
CHANGED
@@ -1,54 +1,9 @@
|
|
1
|
-
# RR [![Build Status](https://
|
1
|
+
# RR [![Gem Version](https://badge.fury.io/rb/rr.png)](http://badge.fury.io/rb/rr) [![Build Status](https://travis-ci.org/rr/rr.png?branch=master)](https://travis-ci.org/rr/rr) [![Code Climate GPA](https://codeclimate.com/github/rr/rr.png)](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
|
-
## 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
|
-
~~~
|
36
|
-
|
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
|
-
~~~
|
50
|
-
|
51
|
-
|
52
7
|
## A whirlwind tour of RR
|
53
8
|
|
54
9
|
### Stubs
|
@@ -130,6 +85,51 @@ end
|
|
130
85
|
~~~
|
131
86
|
|
132
87
|
|
88
|
+
## Installing RR into your project
|
89
|
+
|
90
|
+
For minimal setup, RR looks for an existing test framework and then hooks itself
|
91
|
+
into it. Hence, RR works best when loaded *after* the test framework that you
|
92
|
+
are using is loaded.
|
93
|
+
|
94
|
+
If you are using Bundler, you can achieve this by specifying the dependency on
|
95
|
+
RR with `require: false`; then, require RR directly following your test
|
96
|
+
framework.
|
97
|
+
|
98
|
+
Here's what this looks like for different kinds of projects:
|
99
|
+
|
100
|
+
### Ruby project (without Bundler)
|
101
|
+
|
102
|
+
~~~ ruby
|
103
|
+
require 'your/test/framework'
|
104
|
+
require 'rr'
|
105
|
+
~~~
|
106
|
+
|
107
|
+
### Ruby project (with Bundler)
|
108
|
+
|
109
|
+
~~~ ruby
|
110
|
+
# Gemfile
|
111
|
+
gem 'rr', require: false
|
112
|
+
|
113
|
+
# test helper
|
114
|
+
require 'your/test/framework'
|
115
|
+
require 'rr'
|
116
|
+
~~~
|
117
|
+
|
118
|
+
### Rails project
|
119
|
+
|
120
|
+
~~~ ruby
|
121
|
+
# Gemfile
|
122
|
+
group :test do
|
123
|
+
gem 'rr', require: false
|
124
|
+
end
|
125
|
+
|
126
|
+
# test helper
|
127
|
+
require File.expand_path('../../config/environment', __FILE__)
|
128
|
+
require 'your/test/framework' # if you are using something other than MiniTest / Test::Unit
|
129
|
+
require 'rr'
|
130
|
+
~~~
|
131
|
+
|
132
|
+
|
133
133
|
## Learning more
|
134
134
|
|
135
135
|
1. [What is a test double?](doc/01_test_double.md)
|
@@ -137,83 +137,71 @@ end
|
|
137
137
|
3. [API overview](doc/03_api_overview.md)
|
138
138
|
|
139
139
|
|
140
|
+
## Compatibility
|
141
|
+
|
142
|
+
RR is designed and tested to work against the following Ruby versions:
|
143
|
+
|
144
|
+
* 1.8.7-p374
|
145
|
+
* 1.9.3-p392
|
146
|
+
* 2.0.0-p195
|
147
|
+
* JRuby 1.7.4
|
148
|
+
|
149
|
+
as well as the following test frameworks:
|
150
|
+
|
151
|
+
* RSpec 1 (Ruby 1.8.7)
|
152
|
+
* RSpec 2 (Ruby 1.9+)
|
153
|
+
* Test::Unit 1 (Ruby 1.8.7)
|
154
|
+
* Test::Unit 2.4.x (Ruby 1.8.7)
|
155
|
+
* Test::Unit 2.0.0 (Ruby 1.9+)
|
156
|
+
* Test::Unit 2.5.x (Ruby 1.9+)
|
157
|
+
* MiniTest 4 (Ruby 1.9+)
|
158
|
+
* Minitest 5 (Ruby 1.9+)
|
159
|
+
|
160
|
+
and the following Rails versions:
|
161
|
+
|
162
|
+
* Rails 2.3.x (Ruby 1.8.7)
|
163
|
+
* Rails 3.2.x (Ruby 1.9+)
|
164
|
+
* Rails 4.0.x (Ruby 1.9+)
|
165
|
+
|
166
|
+
|
140
167
|
## Help!
|
141
168
|
|
142
|
-
|
143
|
-
|
144
|
-
and I'll respond as soon as I can.
|
169
|
+
If you have a question or are having trouble, simply [post it as an
|
170
|
+
issue](http://github.com/rr/rr/issues) and I'll respond as soon as I can.
|
145
171
|
|
146
172
|
|
147
173
|
## Contributing
|
148
174
|
|
149
|
-
Want to contribute a
|
175
|
+
Want to contribute a bug fix or new feature to RR? Great! Follow these steps:
|
150
176
|
|
151
|
-
1.
|
177
|
+
1. Make sure you have Ruby 2.0.0-p195 installed (this is the primary Ruby
|
152
178
|
version that RR targets).
|
153
179
|
2. Clone the repo (you probably knew that already).
|
154
180
|
3. Make a new branch off of `master` with a descriptive name.
|
155
|
-
4. Work on your
|
181
|
+
4. Work on your patch.
|
156
182
|
5. Run `bundle install`.
|
157
183
|
6. Ensure all of the tests pass by running `bundle exec rake`.
|
158
184
|
7. If you want to go the extra mile, install the other Ruby versions listed
|
159
|
-
|
185
|
+
above in the compatibility table, and repeat steps 5-6. See the "Running test
|
160
186
|
suites" section below for more information.
|
161
|
-
8. When you're done,
|
162
|
-
|
187
|
+
8. When you're done, push your branch and create a pull request from it.
|
188
|
+
I'll respond as soon as I can.
|
163
189
|
|
164
|
-
### Running
|
190
|
+
### Running tests
|
165
191
|
|
166
|
-
|
167
|
-
multiple
|
168
|
-
Rake tasks
|
169
|
-
full list with:
|
192
|
+
As indicated by the compatibility list above, in order to test support for
|
193
|
+
multiple Ruby versions and environments, there are multiple test suites, and
|
194
|
+
Rake tasks to run these suites. The list of available Rake tasks depends on
|
195
|
+
which version of Ruby you are under, but you can get the full list with:
|
170
196
|
|
171
|
-
rake -D spec:
|
197
|
+
bundle exec rake -D spec:
|
172
198
|
|
173
199
|
To run all the suites, simply say:
|
174
200
|
|
175
|
-
rake
|
201
|
+
bundle exec rake
|
176
202
|
|
177
203
|
(Incidentally, this is also the command which Travis runs.)
|
178
204
|
|
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
205
|
|
218
206
|
## Author/Contact
|
219
207
|
|
@@ -224,13 +212,10 @@ Winkler (<elliot.winkler@gmail.com>).
|
|
224
212
|
## Credits
|
225
213
|
|
226
214
|
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!)
|
215
|
+
making it possible; RR is no exception! [You can read the full list of
|
216
|
+
credits here](CREDITS.md).
|
231
217
|
|
232
218
|
|
233
219
|
## License
|
234
220
|
|
235
|
-
RR is available under the MIT license
|
236
|
-
scoop.
|
221
|
+
RR is available under the [MIT license](LICENSE).
|
data/Rakefile
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler'
|
3
|
+
require 'rake'
|
4
|
+
|
5
|
+
require 'pp'
|
6
|
+
|
7
|
+
# appraisal
|
8
|
+
require 'appraisal'
|
9
|
+
|
10
|
+
# build, install, release
|
11
|
+
require 'bundler/gem_tasks'
|
12
|
+
|
13
|
+
# appraisals
|
14
|
+
Appraisal::File.each do |appraisal|
|
15
|
+
desc "Resolve and install dependencies for the #{appraisal.name} appraisal"
|
16
|
+
task "appraisal:#{appraisal.name}:install" do
|
17
|
+
appraisal.install
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
# spec
|
22
|
+
require File.expand_path('../spec/defines_spec_suite_tasks', __FILE__)
|
23
|
+
DefinesSpecSuiteTasks.call
|
24
|
+
task :default => ['appraisal:install', :spec]
|
25
|
+
|
26
|
+
task :package_tests do
|
27
|
+
require File.expand_path('../lib/rr/version', __FILE__)
|
28
|
+
require 'aws/s3'
|
29
|
+
require 'archive/tar/minitar'
|
30
|
+
require 'dotenv'
|
31
|
+
|
32
|
+
Dotenv.load
|
33
|
+
AWS.config(
|
34
|
+
:access_key_id => ENV['AWS_ACCESS_KEY_ID'],
|
35
|
+
:secret_access_key => ENV['AWS_SECRET_ACCESS_KEY']
|
36
|
+
)
|
37
|
+
|
38
|
+
file_path = File.join(Dir.tmpdir, "rr-#{RR.version}-tests.tar")
|
39
|
+
File.open(file_path, 'wb') do |fh|
|
40
|
+
Zlib::GzipWriter.open(fh) do |zfh|
|
41
|
+
Archive::Tar::Minitar.pack('spec', zfh)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
puts "Wrote to #{file_path}."
|
45
|
+
|
46
|
+
remote_file_path = "v#{RR.version}.tar.gz"
|
47
|
+
bucket_name = 'rubygem-rr/tests'
|
48
|
+
puts "Uploading #{file_path} to s3.amazonaws.com/#{bucket_name}/#{remote_file_path} ..."
|
49
|
+
s3 = AWS::S3.new
|
50
|
+
bucket = s3.buckets[bucket_name]
|
51
|
+
object = bucket.objects[remote_file_path]
|
52
|
+
File.open(file_path, 'rb') {|f| object.write(f) }
|
53
|
+
object.acl = :public_read
|
54
|
+
end
|
55
|
+
task :release => :package_tests
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# This file was generated by Appraisal
|
2
|
+
|
3
|
+
source "https://rubygems.org"
|
4
|
+
|
5
|
+
gem "rake", "~> 10.0"
|
6
|
+
gem "aws-sdk", "~> 1.0"
|
7
|
+
gem "minitar", "~> 0.5"
|
8
|
+
gem "dotenv", "~> 0.7"
|
9
|
+
gem "simplecov", "~> 0.7"
|
10
|
+
gem "appraisal", "~> 0.5"
|
11
|
+
gem "posix-spawn", :platforms=>:mri
|
12
|
+
gem "open4", :platforms=>:mri
|
13
|
+
gem "rspec", "~> 1.3"
|
14
|
+
|
@@ -0,0 +1,38 @@
|
|
1
|
+
GEM
|
2
|
+
remote: https://rubygems.org/
|
3
|
+
specs:
|
4
|
+
appraisal (0.5.2)
|
5
|
+
bundler
|
6
|
+
rake
|
7
|
+
aws-sdk (1.9.2)
|
8
|
+
json (~> 1.4)
|
9
|
+
nokogiri (>= 1.4.4)
|
10
|
+
uuidtools (~> 2.1)
|
11
|
+
dotenv (0.7.0)
|
12
|
+
json (1.7.7)
|
13
|
+
minitar (0.5.4)
|
14
|
+
multi_json (1.7.7)
|
15
|
+
nokogiri (1.5.9)
|
16
|
+
open4 (1.3.0)
|
17
|
+
posix-spawn (0.3.6)
|
18
|
+
rake (10.0.4)
|
19
|
+
rspec (1.3.2)
|
20
|
+
simplecov (0.7.1)
|
21
|
+
multi_json (~> 1.0)
|
22
|
+
simplecov-html (~> 0.7.1)
|
23
|
+
simplecov-html (0.7.1)
|
24
|
+
uuidtools (2.1.4)
|
25
|
+
|
26
|
+
PLATFORMS
|
27
|
+
ruby
|
28
|
+
|
29
|
+
DEPENDENCIES
|
30
|
+
appraisal (~> 0.5)
|
31
|
+
aws-sdk (~> 1.0)
|
32
|
+
dotenv (~> 0.7)
|
33
|
+
minitar (~> 0.5)
|
34
|
+
open4
|
35
|
+
posix-spawn
|
36
|
+
rake (~> 10.0)
|
37
|
+
rspec (~> 1.3)
|
38
|
+
simplecov (~> 0.7)
|