shoulda-matchers 2.6.1 → 2.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +9 -0
- data/.yardopts +8 -0
- data/Appraisals +82 -33
- data/Gemfile +18 -2
- data/Gemfile.lock +13 -1
- data/NEWS.md +27 -2
- data/README.md +83 -1329
- data/Rakefile +118 -1
- data/cucumber.yml +1 -0
- data/doc_config/gh-pages/index.html.erb +9 -0
- data/doc_config/yard/setup.rb +22 -0
- data/doc_config/yard/templates/default/fulldoc/html/css/bootstrap.css +5967 -0
- data/doc_config/yard/templates/default/fulldoc/html/css/full_list.css +12 -0
- data/doc_config/yard/templates/default/fulldoc/html/css/global.css +45 -0
- data/doc_config/yard/templates/default/fulldoc/html/css/solarized.css +69 -0
- data/doc_config/yard/templates/default/fulldoc/html/css/style.css +283 -0
- data/doc_config/yard/templates/default/fulldoc/html/full_list.erb +32 -0
- data/doc_config/yard/templates/default/fulldoc/html/full_list_class.erb +1 -0
- data/doc_config/yard/templates/default/fulldoc/html/full_list_method.erb +8 -0
- data/doc_config/yard/templates/default/fulldoc/html/js/app.js +298 -0
- data/doc_config/yard/templates/default/fulldoc/html/js/full_list.js +1 -0
- data/doc_config/yard/templates/default/fulldoc/html/js/jquery.stickyheaders.js +289 -0
- data/doc_config/yard/templates/default/fulldoc/html/js/underscore.min.js +6 -0
- data/doc_config/yard/templates/default/fulldoc/html/setup.rb +8 -0
- data/doc_config/yard/templates/default/layout/html/breadcrumb.erb +14 -0
- data/doc_config/yard/templates/default/layout/html/fonts.erb +1 -0
- data/doc_config/yard/templates/default/layout/html/layout.erb +23 -0
- data/doc_config/yard/templates/default/layout/html/search.erb +13 -0
- data/doc_config/yard/templates/default/layout/html/setup.rb +40 -0
- data/doc_config/yard/templates/default/method_details/html/source.erb +10 -0
- data/doc_config/yard/templates/default/module/html/box_info.erb +31 -0
- data/docs.watchr +5 -0
- data/features/rails_integration.feature +32 -0
- data/features/step_definitions/rails_steps.rb +55 -9
- data/features/support/env.rb +1 -0
- data/gemfiles/3.0.gemfile +13 -1
- data/gemfiles/3.0.gemfile.lock +13 -1
- data/gemfiles/3.1.gemfile +17 -2
- data/gemfiles/3.1.gemfile.lock +31 -2
- data/gemfiles/3.1_1.9.2.gemfile +33 -0
- data/gemfiles/3.1_1.9.2.gemfile.lock +203 -0
- data/gemfiles/3.2.gemfile +18 -2
- data/gemfiles/3.2.gemfile.lock +32 -2
- data/gemfiles/3.2_1.9.2.gemfile +32 -0
- data/gemfiles/3.2_1.9.2.gemfile.lock +200 -0
- data/gemfiles/4.0.0.gemfile +20 -1
- data/gemfiles/4.0.0.gemfile.lock +46 -2
- data/gemfiles/4.0.1.gemfile +20 -1
- data/gemfiles/4.0.1.gemfile.lock +46 -2
- data/gemfiles/4.1.gemfile +21 -2
- data/gemfiles/4.1.gemfile.lock +47 -4
- data/lib/shoulda/matchers/action_controller.rb +0 -20
- data/lib/shoulda/matchers/action_controller/callback_matcher.rb +119 -28
- data/lib/shoulda/matchers/action_controller/filter_param_matcher.rb +22 -6
- data/lib/shoulda/matchers/action_controller/redirect_to_matcher.rb +43 -10
- data/lib/shoulda/matchers/action_controller/render_template_matcher.rb +40 -13
- data/lib/shoulda/matchers/action_controller/render_with_layout_matcher.rb +63 -11
- data/lib/shoulda/matchers/action_controller/rescue_from_matcher.rb +34 -1
- data/lib/shoulda/matchers/action_controller/respond_with_matcher.rb +84 -15
- data/lib/shoulda/matchers/action_controller/route_matcher.rb +84 -28
- data/lib/shoulda/matchers/action_controller/route_params.rb +4 -3
- data/lib/shoulda/matchers/action_controller/set_session_matcher.rb +76 -13
- data/lib/shoulda/matchers/action_controller/set_the_flash_matcher.rb +147 -13
- data/lib/shoulda/matchers/action_controller/strong_parameters_matcher.rb +148 -2
- data/lib/shoulda/matchers/active_model.rb +0 -25
- data/lib/shoulda/matchers/active_model/allow_mass_assignment_of_matcher.rb +66 -9
- data/lib/shoulda/matchers/active_model/allow_value_matcher.rb +161 -19
- data/lib/shoulda/matchers/active_model/disallow_value_matcher.rb +5 -5
- data/lib/shoulda/matchers/active_model/ensure_exclusion_of_matcher.rb +92 -13
- data/lib/shoulda/matchers/active_model/ensure_inclusion_of_matcher.rb +218 -16
- data/lib/shoulda/matchers/active_model/ensure_length_of_matcher.rb +198 -32
- data/lib/shoulda/matchers/active_model/errors.rb +5 -2
- data/lib/shoulda/matchers/active_model/exception_message_finder.rb +1 -1
- data/lib/shoulda/matchers/active_model/have_secure_password_matcher.rb +29 -8
- data/lib/shoulda/matchers/active_model/helpers.rb +20 -8
- data/lib/shoulda/matchers/active_model/numericality_matchers.rb +9 -0
- data/lib/shoulda/matchers/active_model/numericality_matchers/comparison_matcher.rb +4 -6
- data/lib/shoulda/matchers/active_model/numericality_matchers/even_number_matcher.rb +4 -3
- data/lib/shoulda/matchers/active_model/numericality_matchers/numeric_type_matcher.rb +3 -2
- data/lib/shoulda/matchers/active_model/numericality_matchers/odd_number_matcher.rb +4 -3
- data/lib/shoulda/matchers/active_model/numericality_matchers/only_integer_matcher.rb +4 -3
- data/lib/shoulda/matchers/active_model/validate_absence_of_matcher.rb +52 -14
- data/lib/shoulda/matchers/active_model/validate_acceptance_of_matcher.rb +51 -13
- data/lib/shoulda/matchers/active_model/validate_confirmation_of_matcher.rb +53 -7
- data/lib/shoulda/matchers/active_model/validate_numericality_of_matcher.rb +275 -19
- data/lib/shoulda/matchers/active_model/validate_presence_of_matcher.rb +84 -14
- data/lib/shoulda/matchers/active_model/validate_uniqueness_of_matcher.rb +170 -41
- data/lib/shoulda/matchers/active_model/validation_matcher.rb +20 -15
- data/lib/shoulda/matchers/active_model/validation_message_finder.rb +1 -2
- data/lib/shoulda/matchers/active_record.rb +1 -12
- data/lib/shoulda/matchers/active_record/accept_nested_attributes_for_matcher.rb +89 -15
- data/lib/shoulda/matchers/active_record/association_matcher.rb +726 -70
- data/lib/shoulda/matchers/active_record/association_matchers.rb +9 -0
- data/lib/shoulda/matchers/active_record/association_matchers/counter_cache_matcher.rb +4 -3
- data/lib/shoulda/matchers/active_record/association_matchers/dependent_matcher.rb +4 -3
- data/lib/shoulda/matchers/active_record/association_matchers/inverse_of_matcher.rb +4 -3
- data/lib/shoulda/matchers/active_record/association_matchers/model_reflection.rb +2 -1
- data/lib/shoulda/matchers/active_record/association_matchers/model_reflector.rb +4 -3
- data/lib/shoulda/matchers/active_record/association_matchers/option_verifier.rb +4 -5
- data/lib/shoulda/matchers/active_record/association_matchers/order_matcher.rb +4 -3
- data/lib/shoulda/matchers/active_record/association_matchers/source_matcher.rb +4 -3
- data/lib/shoulda/matchers/active_record/association_matchers/through_matcher.rb +4 -3
- data/lib/shoulda/matchers/active_record/have_db_column_matcher.rb +79 -15
- data/lib/shoulda/matchers/active_record/have_db_index_matcher.rb +64 -15
- data/lib/shoulda/matchers/active_record/have_readonly_attribute_matcher.rb +21 -7
- data/lib/shoulda/matchers/active_record/serialize_matcher.rb +85 -10
- data/lib/shoulda/matchers/assertion_error.rb +7 -1
- data/lib/shoulda/matchers/doublespeak.rb +2 -1
- data/lib/shoulda/matchers/doublespeak/double.rb +3 -1
- data/lib/shoulda/matchers/doublespeak/double_collection.rb +2 -1
- data/lib/shoulda/matchers/doublespeak/double_implementation_registry.rb +1 -0
- data/lib/shoulda/matchers/doublespeak/object_double.rb +2 -1
- data/lib/shoulda/matchers/doublespeak/proxy_implementation.rb +2 -1
- data/lib/shoulda/matchers/doublespeak/structs.rb +2 -0
- data/lib/shoulda/matchers/doublespeak/stub_implementation.rb +2 -1
- data/lib/shoulda/matchers/doublespeak/world.rb +3 -4
- data/lib/shoulda/matchers/error.rb +1 -0
- data/lib/shoulda/matchers/independent/delegate_matcher.rb +108 -20
- data/lib/shoulda/matchers/independent/delegate_matcher/stubbed_target.rb +4 -3
- data/lib/shoulda/matchers/integrations/nunit_test_case_detection.rb +3 -0
- data/lib/shoulda/matchers/rails_shim.rb +3 -2
- data/lib/shoulda/matchers/version.rb +2 -1
- data/lib/shoulda/matchers/warn.rb +1 -0
- data/script/SUPPORTED_VERSIONS +1 -0
- data/script/install_gems_in_all_appraisals +14 -0
- data/script/run_all_tests +14 -0
- data/shoulda-matchers.gemspec +0 -10
- data/spec/report_warnings.rb +7 -0
- data/spec/shoulda/matchers/action_controller/route_matcher_spec.rb +1 -1
- data/spec/shoulda/matchers/action_controller/strong_parameters_matcher_spec.rb +9 -0
- data/spec/shoulda/matchers/active_model/validate_uniqueness_of_matcher_spec.rb +0 -36
- data/spec/shoulda/matchers/active_model/validation_message_finder_spec.rb +2 -2
- data/spec/shoulda/matchers/doublespeak/double_spec.rb +1 -1
- data/spec/shoulda/matchers/doublespeak/world_spec.rb +11 -29
- data/spec/shoulda/matchers/doublespeak_spec.rb +3 -3
- data/spec/spec_helper.rb +17 -0
- data/spec/support/class_builder.rb +4 -0
- data/spec/support/test_application.rb +1 -1
- data/spec/warnings_spy.rb +64 -0
- data/spec/warnings_spy/filesystem.rb +45 -0
- data/spec/warnings_spy/partitioner.rb +29 -0
- data/spec/warnings_spy/reader.rb +64 -0
- data/spec/warnings_spy/reporter.rb +87 -0
- metadata +49 -134
@@ -1,10 +1,15 @@
|
|
1
1
|
module Shoulda
|
2
2
|
module Matchers
|
3
|
-
if
|
3
|
+
if defined?(ActiveSupport::TestCase)
|
4
|
+
# @private
|
5
|
+
AssertionError = ActiveSupport::TestCase::Assertion
|
6
|
+
elsif Gem.ruby_version >= Gem::Version.new('1.8') && Gem.ruby_version < Gem::Version.new('1.9')
|
4
7
|
require 'test/unit'
|
8
|
+
# @private
|
5
9
|
AssertionError = Test::Unit::AssertionFailedError
|
6
10
|
elsif defined?(Test::Unit::AssertionFailedError)
|
7
11
|
# Test::Unit has been loaded already, so we use it
|
12
|
+
# @private
|
8
13
|
AssertionError = Test::Unit::AssertionFailedError
|
9
14
|
elsif Gem.ruby_version >= Gem::Version.new("1.9")
|
10
15
|
begin
|
@@ -12,6 +17,7 @@ module Shoulda
|
|
12
17
|
rescue LoadError
|
13
18
|
require 'minitest/unit'
|
14
19
|
ensure
|
20
|
+
# @private
|
15
21
|
AssertionError = MiniTest::Assertion
|
16
22
|
end
|
17
23
|
else
|
@@ -2,11 +2,12 @@ require 'forwardable'
|
|
2
2
|
|
3
3
|
module Shoulda
|
4
4
|
module Matchers
|
5
|
+
# @private
|
5
6
|
module Doublespeak
|
6
7
|
class << self
|
7
8
|
extend Forwardable
|
8
9
|
|
9
|
-
def_delegators :world, :
|
10
|
+
def_delegators :world, :double_collection_for,
|
10
11
|
:with_doubles_activated
|
11
12
|
|
12
13
|
def world
|
@@ -1,6 +1,7 @@
|
|
1
1
|
module Shoulda
|
2
2
|
module Matchers
|
3
3
|
module Doublespeak
|
4
|
+
# @private
|
4
5
|
class Double
|
5
6
|
attr_reader :calls
|
6
7
|
|
@@ -45,7 +46,7 @@ module Shoulda
|
|
45
46
|
end
|
46
47
|
end
|
47
48
|
|
48
|
-
|
49
|
+
protected
|
49
50
|
|
50
51
|
attr_reader :klass, :method_name, :implementation, :original_method
|
51
52
|
|
@@ -64,6 +65,7 @@ module Shoulda
|
|
64
65
|
|
65
66
|
def restore_original_method
|
66
67
|
original_method = @original_method
|
68
|
+
klass.__send__(:remove_method, method_name)
|
67
69
|
klass.__send__(:define_method, method_name) do |*args, &block|
|
68
70
|
original_method.bind(self).call(*args, &block)
|
69
71
|
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
module Shoulda
|
2
2
|
module Matchers
|
3
3
|
module Doublespeak
|
4
|
+
# @private
|
4
5
|
class DoubleCollection
|
5
6
|
def initialize(klass)
|
6
7
|
@klass = klass
|
@@ -37,7 +38,7 @@ module Shoulda
|
|
37
38
|
end
|
38
39
|
end
|
39
40
|
|
40
|
-
|
41
|
+
protected
|
41
42
|
|
42
43
|
attr_reader :klass, :doubles_by_method_name
|
43
44
|
|
@@ -1,6 +1,7 @@
|
|
1
1
|
module Shoulda
|
2
2
|
module Matchers
|
3
3
|
module Doublespeak
|
4
|
+
# @private
|
4
5
|
class ProxyImplementation
|
5
6
|
extend Forwardable
|
6
7
|
|
@@ -21,7 +22,7 @@ module Shoulda
|
|
21
22
|
double.call_original_method(object, args, block)
|
22
23
|
end
|
23
24
|
|
24
|
-
|
25
|
+
protected
|
25
26
|
|
26
27
|
attr_reader :stub_implementation
|
27
28
|
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
module Shoulda
|
2
2
|
module Matchers
|
3
3
|
module Doublespeak
|
4
|
+
# @private
|
4
5
|
class StubImplementation
|
5
6
|
DoubleImplementationRegistry.register(self, :stub)
|
6
7
|
|
@@ -25,7 +26,7 @@ module Shoulda
|
|
25
26
|
implementation.call(object, args, block)
|
26
27
|
end
|
27
28
|
|
28
|
-
|
29
|
+
protected
|
29
30
|
|
30
31
|
attr_reader :implementation
|
31
32
|
end
|
@@ -1,11 +1,10 @@
|
|
1
1
|
module Shoulda
|
2
2
|
module Matchers
|
3
3
|
module Doublespeak
|
4
|
+
# @private
|
4
5
|
class World
|
5
|
-
def
|
6
|
-
|
7
|
-
double_collections_by_class[klass] = double_collection
|
8
|
-
double_collection
|
6
|
+
def double_collection_for(klass)
|
7
|
+
double_collections_by_class[klass] ||= DoubleCollection.new(klass)
|
9
8
|
end
|
10
9
|
|
11
10
|
def with_doubles_activated
|
@@ -1,30 +1,117 @@
|
|
1
|
-
module Shoulda
|
1
|
+
module Shoulda
|
2
2
|
module Matchers
|
3
|
-
module Independent
|
4
|
-
|
5
|
-
#
|
3
|
+
module Independent
|
4
|
+
# The `delegate_method` matcher tests that an object forwards messages
|
5
|
+
# to other, internal objects by way of delegation.
|
6
|
+
#
|
7
|
+
# In this example, we test that Courier forwards a call to #deliver onto
|
8
|
+
# its PostOffice instance:
|
9
|
+
#
|
10
|
+
# require 'forwardable'
|
11
|
+
#
|
12
|
+
# class Courier
|
13
|
+
# extend Forwardable
|
14
|
+
#
|
15
|
+
# attr_reader :post_office
|
16
|
+
#
|
17
|
+
# def_delegators :post_office, :deliver
|
18
|
+
#
|
19
|
+
# def initialize
|
20
|
+
# @post_office = PostOffice.new
|
21
|
+
# end
|
22
|
+
# end
|
23
|
+
#
|
24
|
+
# # RSpec
|
25
|
+
# describe Courier do
|
26
|
+
# it { should delegate_method(:deliver).to(:post_office) }
|
27
|
+
# end
|
28
|
+
#
|
29
|
+
# # Test::Unit
|
30
|
+
# class CourierTest < Test::Unit::TestCase
|
31
|
+
# should delegate_method(:deliver).to(:post_office)
|
32
|
+
# end
|
33
|
+
#
|
34
|
+
# To employ some terminology, we would say that Courier's #deliver method
|
35
|
+
# is the delegating method, PostOffice is the delegate object, and
|
36
|
+
# PostOffice#deliver is the delegate method.
|
37
|
+
#
|
38
|
+
# #### Qualifiers
|
39
|
+
#
|
40
|
+
# ##### as
|
41
|
+
#
|
42
|
+
# Use `as` if the name of the delegate method is different from the name
|
43
|
+
# of the delegating method.
|
44
|
+
#
|
45
|
+
# Here, Courier has a #deliver method, but instead of calling #deliver on
|
46
|
+
# the PostOffice, it calls #ship:
|
47
|
+
#
|
48
|
+
# class Courier
|
49
|
+
# attr_reader :post_office
|
50
|
+
#
|
51
|
+
# def initialize
|
52
|
+
# @post_office = PostOffice.new
|
53
|
+
# end
|
54
|
+
#
|
55
|
+
# def deliver(package)
|
56
|
+
# post_office.ship(package)
|
57
|
+
# end
|
58
|
+
# end
|
59
|
+
#
|
60
|
+
# # RSpec
|
61
|
+
# describe Courier do
|
62
|
+
# it { should delegate_method(:deliver).to(:post_office).as(:ship) }
|
63
|
+
# end
|
64
|
+
#
|
65
|
+
# # Test::Unit
|
66
|
+
# class CourierTest < Test::Unit::TestCase
|
67
|
+
# should delegate_method(:deliver).to(:post_office).as(:ship)
|
68
|
+
# end
|
69
|
+
#
|
70
|
+
# ##### with_arguments
|
71
|
+
#
|
72
|
+
# Use `with_arguments` to assert that the delegate method is called with
|
73
|
+
# certain arguments.
|
74
|
+
#
|
75
|
+
# Here, when Courier#deliver calls PostOffice#ship, it adds an options
|
76
|
+
# hash:
|
77
|
+
#
|
78
|
+
# class Courier
|
79
|
+
# attr_reader :post_office
|
80
|
+
#
|
81
|
+
# def initialize
|
82
|
+
# @post_office = PostOffice.new
|
83
|
+
# end
|
84
|
+
#
|
85
|
+
# def deliver(package)
|
86
|
+
# post_office.ship(package, expedited: true)
|
87
|
+
# end
|
88
|
+
# end
|
6
89
|
#
|
7
|
-
#
|
8
|
-
#
|
90
|
+
# # RSpec
|
91
|
+
# describe Courier do
|
92
|
+
# it do
|
93
|
+
# should delegate_method(:deliver).
|
94
|
+
# to(:post_office).
|
95
|
+
# as(:ship).
|
96
|
+
# with_arguments(expedited: true)
|
97
|
+
# end
|
98
|
+
# end
|
9
99
|
#
|
10
|
-
#
|
11
|
-
#
|
12
|
-
#
|
13
|
-
#
|
14
|
-
#
|
100
|
+
# # Test::Unit
|
101
|
+
# class CourierTest < Test::Unit::TestCase
|
102
|
+
# should delegate_method(:deliver).
|
103
|
+
# to(:post_office).
|
104
|
+
# as(:ship).
|
105
|
+
# with_arguments(expedited: true)
|
106
|
+
# end
|
15
107
|
#
|
16
|
-
#
|
17
|
-
# it { should delegate_method(:deliver_mail).to(:mailman) }
|
18
|
-
# it { should delegate_method(:deliver_mail).to(:mailman).
|
19
|
-
# as(:deliver_mail_via_mailman) }
|
20
|
-
# it { should delegate_method(:deliver_mail).to(:mailman).
|
21
|
-
# as(:deliver_mail_hastily).
|
22
|
-
# with_arguments('221B Baker St.', hastily: true) }
|
108
|
+
# @return [DelegateMatcher]
|
23
109
|
#
|
24
110
|
def delegate_method(delegating_method)
|
25
111
|
DelegateMatcher.new(delegating_method)
|
26
112
|
end
|
27
113
|
|
114
|
+
# @private
|
28
115
|
class DelegateMatcher
|
29
116
|
def initialize(delegating_method)
|
30
117
|
@delegating_method = delegating_method
|
@@ -84,7 +171,7 @@ module Shoulda # :nodoc:
|
|
84
171
|
end
|
85
172
|
alias failure_message_for_should_not failure_message_when_negated
|
86
173
|
|
87
|
-
|
174
|
+
protected
|
88
175
|
|
89
176
|
attr_reader \
|
90
177
|
:delegated_arguments,
|
@@ -164,7 +251,7 @@ module Shoulda # :nodoc:
|
|
164
251
|
|
165
252
|
def register_subject_double_collection
|
166
253
|
double_collection =
|
167
|
-
Doublespeak.
|
254
|
+
Doublespeak.double_collection_for(subject.singleton_class)
|
168
255
|
double_collection.register_stub(target_method).
|
169
256
|
to_return(target_double)
|
170
257
|
|
@@ -196,6 +283,7 @@ module Shoulda # :nodoc:
|
|
196
283
|
string
|
197
284
|
end
|
198
285
|
|
286
|
+
# @private
|
199
287
|
class TargetNotDefinedError < StandardError
|
200
288
|
def message
|
201
289
|
'Delegation needs a target. Use the #to method to define one, e.g.
|
@@ -1,6 +1,7 @@
|
|
1
|
-
module Shoulda
|
1
|
+
module Shoulda
|
2
2
|
module Matchers
|
3
|
-
module Independent
|
3
|
+
module Independent
|
4
|
+
# @private
|
4
5
|
class DelegateMatcher::StubbedTarget # :nodoc:
|
5
6
|
def initialize(method)
|
6
7
|
@received_method = false
|
@@ -16,7 +17,7 @@ module Shoulda # :nodoc:
|
|
16
17
|
args == received_arguments
|
17
18
|
end
|
18
19
|
|
19
|
-
|
20
|
+
protected
|
20
21
|
|
21
22
|
def stub_method(method)
|
22
23
|
class_eval do
|
@@ -1,6 +1,8 @@
|
|
1
1
|
module Shoulda
|
2
2
|
module Matchers
|
3
|
+
# @private
|
3
4
|
module Integrations
|
5
|
+
# @private
|
4
6
|
module NUnitTestCaseDetection
|
5
7
|
def self.possible_test_case_constants
|
6
8
|
[
|
@@ -29,6 +31,7 @@ module Shoulda
|
|
29
31
|
end
|
30
32
|
end
|
31
33
|
|
34
|
+
# @private
|
32
35
|
def self.nunit_test_case_constants
|
33
36
|
Integrations::NUnitTestCaseDetection.test_case_constants
|
34
37
|
end
|
@@ -0,0 +1 @@
|
|
1
|
+
1.9.2 1.9.3 2.0.0 2.1.1
|
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
SUPPORTED_VERSIONS=$(<script/SUPPORTED_VERSIONS)
|
4
|
+
|
5
|
+
install-gems-for-version() {
|
6
|
+
local version="$1"
|
7
|
+
(export RBENV_VERSION=$version; bundle && bundle exec appraisal install)
|
8
|
+
}
|
9
|
+
|
10
|
+
for version in $SUPPORTED_VERSIONS; do
|
11
|
+
echo
|
12
|
+
echo "*** Installing gems for $version ***"
|
13
|
+
install-gems-for-version $version
|
14
|
+
done
|
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
SUPPORTED_VERSIONS=$(<script/SUPPORTED_VERSIONS)
|
4
|
+
|
5
|
+
run-tests-for-version() {
|
6
|
+
local version="$1"
|
7
|
+
(export RBENV_VERSION=$version; bundle exec rake)
|
8
|
+
}
|
9
|
+
|
10
|
+
for version in $SUPPORTED_VERSIONS; do
|
11
|
+
echo
|
12
|
+
echo "*** Running tests for $version ***"
|
13
|
+
run-tests-for-version $version
|
14
|
+
done
|
data/shoulda-matchers.gemspec
CHANGED
@@ -20,14 +20,4 @@ Gem::Specification.new do |s|
|
|
20
20
|
|
21
21
|
s.required_ruby_version = '>= 1.9.2'
|
22
22
|
s.add_dependency('activesupport', '>= 3.0.0')
|
23
|
-
|
24
|
-
s.add_development_dependency('appraisal', '~> 1.0.0.beta2')
|
25
|
-
s.add_development_dependency('aruba')
|
26
|
-
s.add_development_dependency('pry')
|
27
|
-
s.add_development_dependency('bourne', '~> 1.3')
|
28
|
-
s.add_development_dependency('bundler', '~> 1.1')
|
29
|
-
s.add_development_dependency('cucumber', '~> 1.1')
|
30
|
-
s.add_development_dependency('rails', '~> 3.0')
|
31
|
-
s.add_development_dependency('rake', '>= 0.9.2')
|
32
|
-
s.add_development_dependency('rspec-rails', '>= 2.13.1', '< 3')
|
33
23
|
end
|