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.
Files changed (146) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.travis.yml +9 -0
  4. data/.yardopts +8 -0
  5. data/Appraisals +82 -33
  6. data/Gemfile +18 -2
  7. data/Gemfile.lock +13 -1
  8. data/NEWS.md +27 -2
  9. data/README.md +83 -1329
  10. data/Rakefile +118 -1
  11. data/cucumber.yml +1 -0
  12. data/doc_config/gh-pages/index.html.erb +9 -0
  13. data/doc_config/yard/setup.rb +22 -0
  14. data/doc_config/yard/templates/default/fulldoc/html/css/bootstrap.css +5967 -0
  15. data/doc_config/yard/templates/default/fulldoc/html/css/full_list.css +12 -0
  16. data/doc_config/yard/templates/default/fulldoc/html/css/global.css +45 -0
  17. data/doc_config/yard/templates/default/fulldoc/html/css/solarized.css +69 -0
  18. data/doc_config/yard/templates/default/fulldoc/html/css/style.css +283 -0
  19. data/doc_config/yard/templates/default/fulldoc/html/full_list.erb +32 -0
  20. data/doc_config/yard/templates/default/fulldoc/html/full_list_class.erb +1 -0
  21. data/doc_config/yard/templates/default/fulldoc/html/full_list_method.erb +8 -0
  22. data/doc_config/yard/templates/default/fulldoc/html/js/app.js +298 -0
  23. data/doc_config/yard/templates/default/fulldoc/html/js/full_list.js +1 -0
  24. data/doc_config/yard/templates/default/fulldoc/html/js/jquery.stickyheaders.js +289 -0
  25. data/doc_config/yard/templates/default/fulldoc/html/js/underscore.min.js +6 -0
  26. data/doc_config/yard/templates/default/fulldoc/html/setup.rb +8 -0
  27. data/doc_config/yard/templates/default/layout/html/breadcrumb.erb +14 -0
  28. data/doc_config/yard/templates/default/layout/html/fonts.erb +1 -0
  29. data/doc_config/yard/templates/default/layout/html/layout.erb +23 -0
  30. data/doc_config/yard/templates/default/layout/html/search.erb +13 -0
  31. data/doc_config/yard/templates/default/layout/html/setup.rb +40 -0
  32. data/doc_config/yard/templates/default/method_details/html/source.erb +10 -0
  33. data/doc_config/yard/templates/default/module/html/box_info.erb +31 -0
  34. data/docs.watchr +5 -0
  35. data/features/rails_integration.feature +32 -0
  36. data/features/step_definitions/rails_steps.rb +55 -9
  37. data/features/support/env.rb +1 -0
  38. data/gemfiles/3.0.gemfile +13 -1
  39. data/gemfiles/3.0.gemfile.lock +13 -1
  40. data/gemfiles/3.1.gemfile +17 -2
  41. data/gemfiles/3.1.gemfile.lock +31 -2
  42. data/gemfiles/3.1_1.9.2.gemfile +33 -0
  43. data/gemfiles/3.1_1.9.2.gemfile.lock +203 -0
  44. data/gemfiles/3.2.gemfile +18 -2
  45. data/gemfiles/3.2.gemfile.lock +32 -2
  46. data/gemfiles/3.2_1.9.2.gemfile +32 -0
  47. data/gemfiles/3.2_1.9.2.gemfile.lock +200 -0
  48. data/gemfiles/4.0.0.gemfile +20 -1
  49. data/gemfiles/4.0.0.gemfile.lock +46 -2
  50. data/gemfiles/4.0.1.gemfile +20 -1
  51. data/gemfiles/4.0.1.gemfile.lock +46 -2
  52. data/gemfiles/4.1.gemfile +21 -2
  53. data/gemfiles/4.1.gemfile.lock +47 -4
  54. data/lib/shoulda/matchers/action_controller.rb +0 -20
  55. data/lib/shoulda/matchers/action_controller/callback_matcher.rb +119 -28
  56. data/lib/shoulda/matchers/action_controller/filter_param_matcher.rb +22 -6
  57. data/lib/shoulda/matchers/action_controller/redirect_to_matcher.rb +43 -10
  58. data/lib/shoulda/matchers/action_controller/render_template_matcher.rb +40 -13
  59. data/lib/shoulda/matchers/action_controller/render_with_layout_matcher.rb +63 -11
  60. data/lib/shoulda/matchers/action_controller/rescue_from_matcher.rb +34 -1
  61. data/lib/shoulda/matchers/action_controller/respond_with_matcher.rb +84 -15
  62. data/lib/shoulda/matchers/action_controller/route_matcher.rb +84 -28
  63. data/lib/shoulda/matchers/action_controller/route_params.rb +4 -3
  64. data/lib/shoulda/matchers/action_controller/set_session_matcher.rb +76 -13
  65. data/lib/shoulda/matchers/action_controller/set_the_flash_matcher.rb +147 -13
  66. data/lib/shoulda/matchers/action_controller/strong_parameters_matcher.rb +148 -2
  67. data/lib/shoulda/matchers/active_model.rb +0 -25
  68. data/lib/shoulda/matchers/active_model/allow_mass_assignment_of_matcher.rb +66 -9
  69. data/lib/shoulda/matchers/active_model/allow_value_matcher.rb +161 -19
  70. data/lib/shoulda/matchers/active_model/disallow_value_matcher.rb +5 -5
  71. data/lib/shoulda/matchers/active_model/ensure_exclusion_of_matcher.rb +92 -13
  72. data/lib/shoulda/matchers/active_model/ensure_inclusion_of_matcher.rb +218 -16
  73. data/lib/shoulda/matchers/active_model/ensure_length_of_matcher.rb +198 -32
  74. data/lib/shoulda/matchers/active_model/errors.rb +5 -2
  75. data/lib/shoulda/matchers/active_model/exception_message_finder.rb +1 -1
  76. data/lib/shoulda/matchers/active_model/have_secure_password_matcher.rb +29 -8
  77. data/lib/shoulda/matchers/active_model/helpers.rb +20 -8
  78. data/lib/shoulda/matchers/active_model/numericality_matchers.rb +9 -0
  79. data/lib/shoulda/matchers/active_model/numericality_matchers/comparison_matcher.rb +4 -6
  80. data/lib/shoulda/matchers/active_model/numericality_matchers/even_number_matcher.rb +4 -3
  81. data/lib/shoulda/matchers/active_model/numericality_matchers/numeric_type_matcher.rb +3 -2
  82. data/lib/shoulda/matchers/active_model/numericality_matchers/odd_number_matcher.rb +4 -3
  83. data/lib/shoulda/matchers/active_model/numericality_matchers/only_integer_matcher.rb +4 -3
  84. data/lib/shoulda/matchers/active_model/validate_absence_of_matcher.rb +52 -14
  85. data/lib/shoulda/matchers/active_model/validate_acceptance_of_matcher.rb +51 -13
  86. data/lib/shoulda/matchers/active_model/validate_confirmation_of_matcher.rb +53 -7
  87. data/lib/shoulda/matchers/active_model/validate_numericality_of_matcher.rb +275 -19
  88. data/lib/shoulda/matchers/active_model/validate_presence_of_matcher.rb +84 -14
  89. data/lib/shoulda/matchers/active_model/validate_uniqueness_of_matcher.rb +170 -41
  90. data/lib/shoulda/matchers/active_model/validation_matcher.rb +20 -15
  91. data/lib/shoulda/matchers/active_model/validation_message_finder.rb +1 -2
  92. data/lib/shoulda/matchers/active_record.rb +1 -12
  93. data/lib/shoulda/matchers/active_record/accept_nested_attributes_for_matcher.rb +89 -15
  94. data/lib/shoulda/matchers/active_record/association_matcher.rb +726 -70
  95. data/lib/shoulda/matchers/active_record/association_matchers.rb +9 -0
  96. data/lib/shoulda/matchers/active_record/association_matchers/counter_cache_matcher.rb +4 -3
  97. data/lib/shoulda/matchers/active_record/association_matchers/dependent_matcher.rb +4 -3
  98. data/lib/shoulda/matchers/active_record/association_matchers/inverse_of_matcher.rb +4 -3
  99. data/lib/shoulda/matchers/active_record/association_matchers/model_reflection.rb +2 -1
  100. data/lib/shoulda/matchers/active_record/association_matchers/model_reflector.rb +4 -3
  101. data/lib/shoulda/matchers/active_record/association_matchers/option_verifier.rb +4 -5
  102. data/lib/shoulda/matchers/active_record/association_matchers/order_matcher.rb +4 -3
  103. data/lib/shoulda/matchers/active_record/association_matchers/source_matcher.rb +4 -3
  104. data/lib/shoulda/matchers/active_record/association_matchers/through_matcher.rb +4 -3
  105. data/lib/shoulda/matchers/active_record/have_db_column_matcher.rb +79 -15
  106. data/lib/shoulda/matchers/active_record/have_db_index_matcher.rb +64 -15
  107. data/lib/shoulda/matchers/active_record/have_readonly_attribute_matcher.rb +21 -7
  108. data/lib/shoulda/matchers/active_record/serialize_matcher.rb +85 -10
  109. data/lib/shoulda/matchers/assertion_error.rb +7 -1
  110. data/lib/shoulda/matchers/doublespeak.rb +2 -1
  111. data/lib/shoulda/matchers/doublespeak/double.rb +3 -1
  112. data/lib/shoulda/matchers/doublespeak/double_collection.rb +2 -1
  113. data/lib/shoulda/matchers/doublespeak/double_implementation_registry.rb +1 -0
  114. data/lib/shoulda/matchers/doublespeak/object_double.rb +2 -1
  115. data/lib/shoulda/matchers/doublespeak/proxy_implementation.rb +2 -1
  116. data/lib/shoulda/matchers/doublespeak/structs.rb +2 -0
  117. data/lib/shoulda/matchers/doublespeak/stub_implementation.rb +2 -1
  118. data/lib/shoulda/matchers/doublespeak/world.rb +3 -4
  119. data/lib/shoulda/matchers/error.rb +1 -0
  120. data/lib/shoulda/matchers/independent/delegate_matcher.rb +108 -20
  121. data/lib/shoulda/matchers/independent/delegate_matcher/stubbed_target.rb +4 -3
  122. data/lib/shoulda/matchers/integrations/nunit_test_case_detection.rb +3 -0
  123. data/lib/shoulda/matchers/rails_shim.rb +3 -2
  124. data/lib/shoulda/matchers/version.rb +2 -1
  125. data/lib/shoulda/matchers/warn.rb +1 -0
  126. data/script/SUPPORTED_VERSIONS +1 -0
  127. data/script/install_gems_in_all_appraisals +14 -0
  128. data/script/run_all_tests +14 -0
  129. data/shoulda-matchers.gemspec +0 -10
  130. data/spec/report_warnings.rb +7 -0
  131. data/spec/shoulda/matchers/action_controller/route_matcher_spec.rb +1 -1
  132. data/spec/shoulda/matchers/action_controller/strong_parameters_matcher_spec.rb +9 -0
  133. data/spec/shoulda/matchers/active_model/validate_uniqueness_of_matcher_spec.rb +0 -36
  134. data/spec/shoulda/matchers/active_model/validation_message_finder_spec.rb +2 -2
  135. data/spec/shoulda/matchers/doublespeak/double_spec.rb +1 -1
  136. data/spec/shoulda/matchers/doublespeak/world_spec.rb +11 -29
  137. data/spec/shoulda/matchers/doublespeak_spec.rb +3 -3
  138. data/spec/spec_helper.rb +17 -0
  139. data/spec/support/class_builder.rb +4 -0
  140. data/spec/support/test_application.rb +1 -1
  141. data/spec/warnings_spy.rb +64 -0
  142. data/spec/warnings_spy/filesystem.rb +45 -0
  143. data/spec/warnings_spy/partitioner.rb +29 -0
  144. data/spec/warnings_spy/reader.rb +64 -0
  145. data/spec/warnings_spy/reporter.rb +87 -0
  146. metadata +49 -134
@@ -1,10 +1,15 @@
1
1
  module Shoulda
2
2
  module Matchers
3
- if Gem.ruby_version >= Gem::Version.new('1.8') && Gem.ruby_version < Gem::Version.new('1.9')
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, :register_double_collection,
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
- private
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
- private
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
  module DoubleImplementationRegistry
5
6
  class << self
6
7
  REGISTRY = {}
@@ -1,6 +1,7 @@
1
1
  module Shoulda
2
2
  module Matchers
3
3
  module Doublespeak
4
+ # @private
4
5
  class ObjectDouble < BasicObject
5
6
  attr_reader :calls
6
7
 
@@ -23,7 +24,7 @@ module Shoulda
23
24
  nil
24
25
  end
25
26
 
26
- private
27
+ protected
27
28
 
28
29
  attr_reader :calls_by_method_name
29
30
  end
@@ -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
- private
25
+ protected
25
26
 
26
27
  attr_reader :stub_implementation
27
28
  end
@@ -1,7 +1,9 @@
1
1
  module Shoulda
2
2
  module Matchers
3
3
  module Doublespeak
4
+ # @private
4
5
  MethodCall = Struct.new(:args, :block)
6
+ # @private
5
7
  MethodCallWithName = Struct.new(:method_name, :args, :block)
6
8
  end
7
9
  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
- private
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 register_double_collection(klass)
6
- double_collection = DoubleCollection.new(klass)
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,5 +1,6 @@
1
1
  module Shoulda
2
2
  module Matchers
3
+ # @private
3
4
  class Error < StandardError
4
5
  def self.create(attributes)
5
6
  allocate.tap do |error|
@@ -1,30 +1,117 @@
1
- module Shoulda # :nodoc:
1
+ module Shoulda
2
2
  module Matchers
3
- module Independent # :nodoc:
4
-
5
- # Ensure that a given method is delegated properly.
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
- # Basic Syntax:
8
- # it { should delegate_method(method_name).to(delegate_name) }
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
- # Options:
11
- # * <tt>:as</tt> - The name of the delegating method. Defaults to
12
- # method_name.
13
- # * <tt>:with_arguments</tt> - Tests that the delegate method is called
14
- # with certain arguments.
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
- # Examples:
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
- private
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.register_double_collection(subject.singleton_class)
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 # :nodoc:
1
+ module Shoulda
2
2
  module Matchers
3
- module Independent # :nodoc:
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
- private
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
@@ -1,6 +1,7 @@
1
- module Shoulda # :nodoc:
1
+ module Shoulda
2
2
  module Matchers
3
- class RailsShim # :nodoc:
3
+ # @private
4
+ class RailsShim
4
5
  def self.layouts_ivar
5
6
  if action_pack_major_version >= 4
6
7
  '@_layouts'
@@ -1,5 +1,6 @@
1
1
  module Shoulda
2
2
  module Matchers
3
- VERSION = '2.6.1'.freeze
3
+ # @private
4
+ VERSION = '2.6.2'.freeze
4
5
  end
5
6
  end
@@ -1,5 +1,6 @@
1
1
  module Shoulda
2
2
  module Matchers
3
+ # @private
3
4
  def self.warn(msg)
4
5
  Kernel.warn "Warning from shoulda-matchers:\n\n#{msg}"
5
6
  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
@@ -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