shoulda-matchers 2.5.0 → 2.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (121) hide show
  1. data/.gitignore +8 -7
  2. data/.travis.yml +4 -0
  3. data/Appraisals +8 -0
  4. data/CONTRIBUTING.md +1 -1
  5. data/Gemfile +1 -1
  6. data/Gemfile.lock +77 -66
  7. data/MIT-LICENSE +1 -1
  8. data/NEWS.md +63 -1
  9. data/README.md +189 -33
  10. data/Rakefile +6 -5
  11. data/features/rails_integration.feature +1 -1
  12. data/features/step_definitions/rails_steps.rb +7 -6
  13. data/gemfiles/3.0.gemfile +2 -2
  14. data/gemfiles/3.0.gemfile.lock +14 -5
  15. data/gemfiles/3.1.gemfile +2 -2
  16. data/gemfiles/3.1.gemfile.lock +14 -5
  17. data/gemfiles/3.2.gemfile +2 -2
  18. data/gemfiles/3.2.gemfile.lock +16 -7
  19. data/gemfiles/4.0.0.gemfile +2 -2
  20. data/gemfiles/4.0.0.gemfile.lock +15 -6
  21. data/gemfiles/4.0.1.gemfile +2 -2
  22. data/gemfiles/4.0.1.gemfile.lock +15 -6
  23. data/gemfiles/4.1.gemfile +19 -0
  24. data/gemfiles/4.1.gemfile.lock +176 -0
  25. data/lib/shoulda/matchers.rb +17 -1
  26. data/lib/shoulda/matchers/action_controller.rb +4 -2
  27. data/lib/shoulda/matchers/action_controller/callback_matcher.rb +100 -0
  28. data/lib/shoulda/matchers/action_controller/redirect_to_matcher.rb +1 -1
  29. data/lib/shoulda/matchers/action_controller/render_template_matcher.rb +4 -4
  30. data/lib/shoulda/matchers/action_controller/rescue_from_matcher.rb +1 -1
  31. data/lib/shoulda/matchers/action_controller/route_matcher.rb +12 -12
  32. data/lib/shoulda/matchers/action_controller/route_params.rb +1 -1
  33. data/lib/shoulda/matchers/action_controller/set_the_flash_matcher.rb +2 -1
  34. data/lib/shoulda/matchers/action_controller/strong_parameters_matcher.rb +167 -0
  35. data/lib/shoulda/matchers/active_model.rb +4 -2
  36. data/lib/shoulda/matchers/active_model/allow_value_matcher.rb +23 -5
  37. data/lib/shoulda/matchers/active_model/disallow_value_matcher.rb +0 -4
  38. data/lib/shoulda/matchers/active_model/ensure_inclusion_of_matcher.rb +66 -14
  39. data/lib/shoulda/matchers/active_model/ensure_length_of_matcher.rb +8 -8
  40. data/lib/shoulda/matchers/active_model/errors.rb +40 -0
  41. data/lib/shoulda/matchers/active_model/helpers.rb +6 -6
  42. data/lib/shoulda/matchers/active_model/numericality_matchers/comparison_matcher.rb +33 -14
  43. data/lib/shoulda/matchers/active_model/numericality_matchers/even_number_matcher.rb +26 -0
  44. data/lib/shoulda/matchers/active_model/numericality_matchers/{odd_even_number_matcher.rb → numeric_type_matcher.rb} +9 -20
  45. data/lib/shoulda/matchers/active_model/numericality_matchers/odd_number_matcher.rb +26 -0
  46. data/lib/shoulda/matchers/active_model/numericality_matchers/only_integer_matcher.rb +5 -21
  47. data/lib/shoulda/matchers/active_model/validate_confirmation_of_matcher.rb +1 -1
  48. data/lib/shoulda/matchers/active_model/validate_numericality_of_matcher.rb +71 -22
  49. data/lib/shoulda/matchers/active_model/validate_presence_of_matcher.rb +6 -1
  50. data/lib/shoulda/matchers/active_model/validate_uniqueness_of_matcher.rb +25 -6
  51. data/lib/shoulda/matchers/active_record.rb +1 -0
  52. data/lib/shoulda/matchers/active_record/association_matcher.rb +67 -13
  53. data/lib/shoulda/matchers/active_record/association_matchers/inverse_of_matcher.rb +40 -0
  54. data/lib/shoulda/matchers/active_record/association_matchers/model_reflection.rb +24 -1
  55. data/lib/shoulda/matchers/active_record/association_matchers/model_reflector.rb +1 -1
  56. data/lib/shoulda/matchers/active_record/have_db_column_matcher.rb +1 -1
  57. data/lib/shoulda/matchers/active_record/have_db_index_matcher.rb +1 -1
  58. data/lib/shoulda/matchers/assertion_error.rb +7 -2
  59. data/lib/shoulda/matchers/error.rb +24 -0
  60. data/lib/shoulda/matchers/independent.rb +10 -0
  61. data/lib/shoulda/matchers/independent/delegate_matcher.rb +157 -0
  62. data/lib/shoulda/matchers/independent/delegate_matcher/stubbed_target.rb +34 -0
  63. data/lib/shoulda/matchers/integrations/nunit_test_case_detection.rb +36 -0
  64. data/lib/shoulda/matchers/integrations/rspec.rb +13 -14
  65. data/lib/shoulda/matchers/integrations/test_unit.rb +11 -9
  66. data/lib/shoulda/matchers/version.rb +1 -1
  67. data/lib/shoulda/matchers/warn.rb +7 -0
  68. data/shoulda-matchers.gemspec +2 -1
  69. data/spec/shoulda/matchers/action_controller/callback_matcher_spec.rb +79 -0
  70. data/spec/shoulda/matchers/action_controller/filter_param_matcher_spec.rb +3 -3
  71. data/spec/shoulda/matchers/action_controller/redirect_to_matcher_spec.rb +11 -11
  72. data/spec/shoulda/matchers/action_controller/render_template_matcher_spec.rb +21 -21
  73. data/spec/shoulda/matchers/action_controller/render_with_layout_matcher_spec.rb +10 -10
  74. data/spec/shoulda/matchers/action_controller/rescue_from_matcher_spec.rb +45 -18
  75. data/spec/shoulda/matchers/action_controller/respond_with_matcher_spec.rb +8 -8
  76. data/spec/shoulda/matchers/action_controller/route_matcher_spec.rb +19 -19
  77. data/spec/shoulda/matchers/action_controller/route_params_spec.rb +6 -6
  78. data/spec/shoulda/matchers/action_controller/set_session_matcher_spec.rb +11 -11
  79. data/spec/shoulda/matchers/action_controller/set_the_flash_matcher_spec.rb +44 -44
  80. data/spec/shoulda/matchers/action_controller/strong_parameters_matcher_spec.rb +205 -0
  81. data/spec/shoulda/matchers/active_model/allow_mass_assignment_of_matcher_spec.rb +24 -24
  82. data/spec/shoulda/matchers/active_model/allow_value_matcher_spec.rb +37 -37
  83. data/spec/shoulda/matchers/active_model/disallow_value_matcher_spec.rb +17 -21
  84. data/spec/shoulda/matchers/active_model/ensure_exclusion_of_matcher_spec.rb +24 -24
  85. data/spec/shoulda/matchers/active_model/ensure_inclusion_of_matcher_spec.rb +173 -67
  86. data/spec/shoulda/matchers/active_model/ensure_length_of_matcher_spec.rb +40 -40
  87. data/spec/shoulda/matchers/active_model/exception_message_finder_spec.rb +20 -20
  88. data/spec/shoulda/matchers/active_model/helpers_spec.rb +27 -25
  89. data/spec/shoulda/matchers/active_model/numericality_matchers/comparison_matcher_spec.rb +126 -13
  90. data/spec/shoulda/matchers/active_model/numericality_matchers/even_number_matcher_spec.rb +59 -0
  91. data/spec/shoulda/matchers/active_model/numericality_matchers/odd_number_matcher_spec.rb +59 -0
  92. data/spec/shoulda/matchers/active_model/numericality_matchers/only_integer_matcher_spec.rb +27 -26
  93. data/spec/shoulda/matchers/active_model/validate_absence_of_matcher_spec.rb +15 -15
  94. data/spec/shoulda/matchers/active_model/validate_acceptance_of_matcher_spec.rb +8 -8
  95. data/spec/shoulda/matchers/active_model/validate_confirmation_of_matcher_spec.rb +9 -9
  96. data/spec/shoulda/matchers/active_model/validate_numericality_of_matcher_spec.rb +229 -44
  97. data/spec/shoulda/matchers/active_model/validate_presence_of_matcher_spec.rb +44 -25
  98. data/spec/shoulda/matchers/active_model/validate_uniqueness_of_matcher_spec.rb +110 -62
  99. data/spec/shoulda/matchers/active_model/validation_message_finder_spec.rb +19 -19
  100. data/spec/shoulda/matchers/active_record/accept_nested_attributes_for_matcher_spec.rb +30 -30
  101. data/spec/shoulda/matchers/active_record/association_matcher_spec.rb +378 -192
  102. data/spec/shoulda/matchers/active_record/association_matchers/model_reflection_spec.rb +4 -0
  103. data/spec/shoulda/matchers/active_record/have_db_column_matcher_spec.rb +33 -33
  104. data/spec/shoulda/matchers/active_record/have_db_index_matcher_spec.rb +21 -17
  105. data/spec/shoulda/matchers/active_record/have_readonly_attributes_matcher_spec.rb +8 -8
  106. data/spec/shoulda/matchers/active_record/serialize_matcher_spec.rb +14 -14
  107. data/spec/shoulda/matchers/independent/delegate_matcher/stubbed_target_spec.rb +43 -0
  108. data/spec/shoulda/matchers/independent/delegate_matcher_spec.rb +184 -0
  109. data/spec/spec_helper.rb +4 -0
  110. data/spec/support/activemodel_helpers.rb +2 -2
  111. data/spec/support/capture_helpers.rb +19 -0
  112. data/spec/support/controller_builder.rb +22 -3
  113. data/spec/support/fail_with_message_including_matcher.rb +33 -0
  114. data/spec/support/model_builder.rb +1 -1
  115. data/spec/support/shared_examples/numerical_submatcher.rb +19 -0
  116. data/spec/support/shared_examples/numerical_type_submatcher.rb +17 -0
  117. data/spec/support/test_application.rb +23 -0
  118. metadata +90 -22
  119. checksums.yaml +0 -7
  120. data/spec/shoulda/matchers/active_model/numericality_matchers/odd_even_number_matcher_spec.rb +0 -97
  121. data/spec/support/shared_examples/numerical_submatcher_spec.rb +0 -23
@@ -16,6 +16,10 @@ $LOAD_PATH << File.join(PROJECT_ROOT, 'lib')
16
16
  Dir[ File.join(PROJECT_ROOT, 'spec/support/**/*.rb') ].each { |file| require file }
17
17
 
18
18
  RSpec.configure do |config|
19
+ config.expect_with :rspec do |c|
20
+ c.syntax = :expect
21
+ end
22
+
19
23
  config.mock_with :mocha
20
24
  config.include Shoulda::Matchers::ActionController,
21
25
  example_group: { file_path: /action_controller/ }
@@ -1,6 +1,6 @@
1
1
  module ActiveModelHelpers
2
2
  def custom_validation(&block)
3
- define_model(:example, :attr => :integer) do
3
+ define_model(:example, attr: :integer) do
4
4
  validate :custom_validation
5
5
 
6
6
  define_method(:custom_validation, &block)
@@ -8,7 +8,7 @@ module ActiveModelHelpers
8
8
  end
9
9
 
10
10
  def validating_format(options)
11
- define_model :example, :attr => :string do
11
+ define_model :example, attr: :string do
12
12
  validates_format_of :attr, options
13
13
  end.new
14
14
  end
@@ -0,0 +1,19 @@
1
+ module Kernel
2
+ unless method_defined?(:capture)
3
+ def capture(stream)
4
+ stream = stream.to_s
5
+ captured_stream = Tempfile.new(stream)
6
+ stream_io = eval("$#{stream}")
7
+ origin_stream = stream_io.dup
8
+ stream_io.reopen(captured_stream)
9
+
10
+ yield
11
+
12
+ stream_io.rewind
13
+ return captured_stream.read
14
+ ensure
15
+ captured_stream.unlink
16
+ stream_io.reopen(origin_stream)
17
+ end
18
+ end
19
+ end
@@ -21,10 +21,10 @@ module ControllerBuilder
21
21
  end
22
22
  end
23
23
 
24
- def build_response(opts = {}, &block)
24
+ def build_fake_response(opts = {}, &block)
25
25
  action = opts[:action] || 'example'
26
26
  partial = opts[:partial] || '_partial'
27
- block ||= lambda { render :nothing => true }
27
+ block ||= lambda { render nothing: true }
28
28
  controller_class = define_controller('Examples') do
29
29
  layout false
30
30
  define_method(action, &block)
@@ -32,7 +32,7 @@ module ControllerBuilder
32
32
  controller_class.view_paths = [ $test_app.temp_views_dir_path ]
33
33
 
34
34
  define_routes do
35
- get 'examples', :to => "examples##{action}"
35
+ get 'examples', to: "examples##{action}"
36
36
  end
37
37
 
38
38
  create_view("examples/#{action}.html.erb", 'action')
@@ -58,6 +58,25 @@ module ControllerBuilder
58
58
  $test_app.create_temp_view(path, contents)
59
59
  end
60
60
 
61
+ def controller_for_resource_with_strong_parameters(options = {}, &block)
62
+ define_model "User"
63
+ controller_class = define_controller "Users" do
64
+ define_method options.fetch(:action) do
65
+ @user = User.create(user_params)
66
+ render nothing: true
67
+ end
68
+
69
+ private
70
+ define_method :user_params, &block
71
+ end
72
+
73
+ setup_rails_controller_test(controller_class)
74
+
75
+ define_routes { resources :users }
76
+
77
+ controller_class
78
+ end
79
+
61
80
  private
62
81
 
63
82
  def delete_temporary_views
@@ -0,0 +1,33 @@
1
+ RSpec::Matchers.define :fail_with_message_including do |expected|
2
+ match do |block|
3
+ @actual = nil
4
+
5
+ begin
6
+ block.call
7
+ rescue RSpec::Expectations::ExpectationNotMetError => ex
8
+ @actual = ex.message
9
+ end
10
+
11
+ @actual && @actual.include?(expected)
12
+ end
13
+
14
+ failure_message_for_should do
15
+ msg = "Expectation should have failed with message including '#{expected}'"
16
+
17
+ if @actual
18
+ msg << ", actually failed with '#{@actual}'"
19
+ else
20
+ msg << ", but did not fail."
21
+ end
22
+
23
+ msg
24
+ end
25
+
26
+ failure_message_for_should_not do
27
+ msg = "Expectation should not have failed with message including '#{expected}'"
28
+ msg << ", but did."
29
+
30
+ msg
31
+ end
32
+
33
+ end
@@ -59,7 +59,7 @@ module ModelBuilder
59
59
 
60
60
  if columns.key?(:id) && columns[:id] == false
61
61
  columns.delete(:id)
62
- create_table(table_name, :id => false, &table_block)
62
+ create_table(table_name, id: false, &table_block)
63
63
  else
64
64
  create_table(table_name, &table_block)
65
65
  end
@@ -0,0 +1,19 @@
1
+ require 'spec_helper'
2
+
3
+ shared_examples 'a numerical submatcher' do
4
+ it 'implements the with_message method' do
5
+ expect(subject).to respond_to(:with_message).with(1).arguments
6
+ end
7
+
8
+ it 'implements the matches? method' do
9
+ expect(subject).to respond_to(:matches?).with(1).arguments
10
+ end
11
+
12
+ it 'implements the failure_message method' do
13
+ expect(subject).to respond_to(:failure_message).with(0).arguments
14
+ end
15
+
16
+ it 'implements the failure_message_when_negated method' do
17
+ expect(subject).to respond_to(:failure_message_when_negated).with(0).arguments
18
+ end
19
+ end
@@ -0,0 +1,17 @@
1
+ require 'spec_helper'
2
+
3
+ shared_examples 'a numerical type submatcher' do
4
+ it 'implements the allowed_type method' do
5
+ expect(subject).to respond_to(:allowed_type).with(0).arguments
6
+ expect { subject.allowed_type }.not_to raise_error
7
+ end
8
+
9
+ it 'implements the diff_to_compare' do
10
+ expect(subject).to respond_to(:diff_to_compare).with(0).arguments
11
+ expect { subject.diff_to_compare }.not_to raise_error
12
+ end
13
+
14
+ it 'returns itself when given a message' do
15
+ expect(subject.with_message('some message')).to eq subject
16
+ end
17
+ end
@@ -56,9 +56,32 @@ class TestApplication
56
56
  end
57
57
 
58
58
  def generate
59
+ rails_new
60
+ fix_available_locales_warning
61
+ end
62
+
63
+ def rails_new
59
64
  `rails new #{ROOT_DIR} --skip-bundle`
60
65
  end
61
66
 
67
+ def fix_available_locales_warning
68
+ # See here for more on this:
69
+ # http://stackoverflow.com/questions/20361428/rails-i18n-validation-deprecation-warning
70
+
71
+ filename = File.join(ROOT_DIR, 'config/application.rb')
72
+
73
+ lines = File.read(filename).split("\n")
74
+ lines.insert(-3, <<EOT)
75
+ if I18n.respond_to?(:enforce_available_locales=)
76
+ I18n.enforce_available_locales = false
77
+ end
78
+ EOT
79
+
80
+ File.open(filename, 'w') do |f|
81
+ f.write(lines.join("\n"))
82
+ end
83
+ end
84
+
62
85
  def load_environment
63
86
  require environment_file_path
64
87
  end
metadata CHANGED
@@ -1,7 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shoulda-matchers
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.0
4
+ version: 2.6.0
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Tammer Saleh
@@ -13,53 +14,76 @@ authors:
13
14
  autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
- date: 2014-01-10 00:00:00.000000000 Z
17
+ date: 2014-04-12 00:00:00.000000000 Z
17
18
  dependencies:
18
19
  - !ruby/object:Gem::Dependency
19
20
  name: activesupport
20
21
  requirement: !ruby/object:Gem::Requirement
22
+ none: false
21
23
  requirements:
22
- - - '>='
24
+ - - ! '>='
23
25
  - !ruby/object:Gem::Version
24
26
  version: 3.0.0
25
27
  type: :runtime
26
28
  prerelease: false
27
29
  version_requirements: !ruby/object:Gem::Requirement
30
+ none: false
28
31
  requirements:
29
- - - '>='
32
+ - - ! '>='
30
33
  - !ruby/object:Gem::Version
31
34
  version: 3.0.0
32
35
  - !ruby/object:Gem::Dependency
33
36
  name: appraisal
34
37
  requirement: !ruby/object:Gem::Requirement
38
+ none: false
35
39
  requirements:
36
40
  - - ~>
37
41
  - !ruby/object:Gem::Version
38
- version: '0.4'
42
+ version: 1.0.0.beta2
39
43
  type: :development
40
44
  prerelease: false
41
45
  version_requirements: !ruby/object:Gem::Requirement
46
+ none: false
42
47
  requirements:
43
48
  - - ~>
44
49
  - !ruby/object:Gem::Version
45
- version: '0.4'
50
+ version: 1.0.0.beta2
46
51
  - !ruby/object:Gem::Dependency
47
52
  name: aruba
48
53
  requirement: !ruby/object:Gem::Requirement
54
+ none: false
49
55
  requirements:
50
- - - '>='
56
+ - - ! '>='
51
57
  - !ruby/object:Gem::Version
52
58
  version: '0'
53
59
  type: :development
54
60
  prerelease: false
55
61
  version_requirements: !ruby/object:Gem::Requirement
62
+ none: false
56
63
  requirements:
57
- - - '>='
64
+ - - ! '>='
65
+ - !ruby/object:Gem::Version
66
+ version: '0'
67
+ - !ruby/object:Gem::Dependency
68
+ name: pry
69
+ requirement: !ruby/object:Gem::Requirement
70
+ none: false
71
+ requirements:
72
+ - - ! '>='
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ type: :development
76
+ prerelease: false
77
+ version_requirements: !ruby/object:Gem::Requirement
78
+ none: false
79
+ requirements:
80
+ - - ! '>='
58
81
  - !ruby/object:Gem::Version
59
82
  version: '0'
60
83
  - !ruby/object:Gem::Dependency
61
84
  name: bourne
62
85
  requirement: !ruby/object:Gem::Requirement
86
+ none: false
63
87
  requirements:
64
88
  - - ~>
65
89
  - !ruby/object:Gem::Version
@@ -67,6 +91,7 @@ dependencies:
67
91
  type: :development
68
92
  prerelease: false
69
93
  version_requirements: !ruby/object:Gem::Requirement
94
+ none: false
70
95
  requirements:
71
96
  - - ~>
72
97
  - !ruby/object:Gem::Version
@@ -74,6 +99,7 @@ dependencies:
74
99
  - !ruby/object:Gem::Dependency
75
100
  name: bundler
76
101
  requirement: !ruby/object:Gem::Requirement
102
+ none: false
77
103
  requirements:
78
104
  - - ~>
79
105
  - !ruby/object:Gem::Version
@@ -81,6 +107,7 @@ dependencies:
81
107
  type: :development
82
108
  prerelease: false
83
109
  version_requirements: !ruby/object:Gem::Requirement
110
+ none: false
84
111
  requirements:
85
112
  - - ~>
86
113
  - !ruby/object:Gem::Version
@@ -88,6 +115,7 @@ dependencies:
88
115
  - !ruby/object:Gem::Dependency
89
116
  name: cucumber
90
117
  requirement: !ruby/object:Gem::Requirement
118
+ none: false
91
119
  requirements:
92
120
  - - ~>
93
121
  - !ruby/object:Gem::Version
@@ -95,6 +123,7 @@ dependencies:
95
123
  type: :development
96
124
  prerelease: false
97
125
  version_requirements: !ruby/object:Gem::Requirement
126
+ none: false
98
127
  requirements:
99
128
  - - ~>
100
129
  - !ruby/object:Gem::Version
@@ -102,6 +131,7 @@ dependencies:
102
131
  - !ruby/object:Gem::Dependency
103
132
  name: rails
104
133
  requirement: !ruby/object:Gem::Requirement
134
+ none: false
105
135
  requirements:
106
136
  - - ~>
107
137
  - !ruby/object:Gem::Version
@@ -109,6 +139,7 @@ dependencies:
109
139
  type: :development
110
140
  prerelease: false
111
141
  version_requirements: !ruby/object:Gem::Requirement
142
+ none: false
112
143
  requirements:
113
144
  - - ~>
114
145
  - !ruby/object:Gem::Version
@@ -116,22 +147,25 @@ dependencies:
116
147
  - !ruby/object:Gem::Dependency
117
148
  name: rake
118
149
  requirement: !ruby/object:Gem::Requirement
150
+ none: false
119
151
  requirements:
120
- - - '>='
152
+ - - ! '>='
121
153
  - !ruby/object:Gem::Version
122
154
  version: 0.9.2
123
155
  type: :development
124
156
  prerelease: false
125
157
  version_requirements: !ruby/object:Gem::Requirement
158
+ none: false
126
159
  requirements:
127
- - - '>='
160
+ - - ! '>='
128
161
  - !ruby/object:Gem::Version
129
162
  version: 0.9.2
130
163
  - !ruby/object:Gem::Dependency
131
164
  name: rspec-rails
132
165
  requirement: !ruby/object:Gem::Requirement
166
+ none: false
133
167
  requirements:
134
- - - '>='
168
+ - - ! '>='
135
169
  - !ruby/object:Gem::Version
136
170
  version: 2.13.1
137
171
  - - <
@@ -140,8 +174,9 @@ dependencies:
140
174
  type: :development
141
175
  prerelease: false
142
176
  version_requirements: !ruby/object:Gem::Requirement
177
+ none: false
143
178
  requirements:
144
- - - '>='
179
+ - - ! '>='
145
180
  - !ruby/object:Gem::Version
146
181
  version: 2.13.1
147
182
  - - <
@@ -176,9 +211,12 @@ files:
176
211
  - gemfiles/4.0.0.gemfile.lock
177
212
  - gemfiles/4.0.1.gemfile
178
213
  - gemfiles/4.0.1.gemfile.lock
214
+ - gemfiles/4.1.gemfile
215
+ - gemfiles/4.1.gemfile.lock
179
216
  - lib/shoulda-matchers.rb
180
217
  - lib/shoulda/matchers.rb
181
218
  - lib/shoulda/matchers/action_controller.rb
219
+ - lib/shoulda/matchers/action_controller/callback_matcher.rb
182
220
  - lib/shoulda/matchers/action_controller/filter_param_matcher.rb
183
221
  - lib/shoulda/matchers/action_controller/redirect_to_matcher.rb
184
222
  - lib/shoulda/matchers/action_controller/render_template_matcher.rb
@@ -189,6 +227,7 @@ files:
189
227
  - lib/shoulda/matchers/action_controller/route_params.rb
190
228
  - lib/shoulda/matchers/action_controller/set_session_matcher.rb
191
229
  - lib/shoulda/matchers/action_controller/set_the_flash_matcher.rb
230
+ - lib/shoulda/matchers/action_controller/strong_parameters_matcher.rb
192
231
  - lib/shoulda/matchers/active_model.rb
193
232
  - lib/shoulda/matchers/active_model/allow_mass_assignment_of_matcher.rb
194
233
  - lib/shoulda/matchers/active_model/allow_value_matcher.rb
@@ -201,7 +240,9 @@ files:
201
240
  - lib/shoulda/matchers/active_model/have_secure_password_matcher.rb
202
241
  - lib/shoulda/matchers/active_model/helpers.rb
203
242
  - lib/shoulda/matchers/active_model/numericality_matchers/comparison_matcher.rb
204
- - lib/shoulda/matchers/active_model/numericality_matchers/odd_even_number_matcher.rb
243
+ - lib/shoulda/matchers/active_model/numericality_matchers/even_number_matcher.rb
244
+ - lib/shoulda/matchers/active_model/numericality_matchers/numeric_type_matcher.rb
245
+ - lib/shoulda/matchers/active_model/numericality_matchers/odd_number_matcher.rb
205
246
  - lib/shoulda/matchers/active_model/numericality_matchers/only_integer_matcher.rb
206
247
  - lib/shoulda/matchers/active_model/validate_absence_of_matcher.rb
207
248
  - lib/shoulda/matchers/active_model/validate_acceptance_of_matcher.rb
@@ -216,6 +257,7 @@ files:
216
257
  - lib/shoulda/matchers/active_record/association_matcher.rb
217
258
  - lib/shoulda/matchers/active_record/association_matchers/counter_cache_matcher.rb
218
259
  - lib/shoulda/matchers/active_record/association_matchers/dependent_matcher.rb
260
+ - lib/shoulda/matchers/active_record/association_matchers/inverse_of_matcher.rb
219
261
  - lib/shoulda/matchers/active_record/association_matchers/model_reflection.rb
220
262
  - lib/shoulda/matchers/active_record/association_matchers/model_reflector.rb
221
263
  - lib/shoulda/matchers/active_record/association_matchers/option_verifier.rb
@@ -227,11 +269,18 @@ files:
227
269
  - lib/shoulda/matchers/active_record/have_readonly_attribute_matcher.rb
228
270
  - lib/shoulda/matchers/active_record/serialize_matcher.rb
229
271
  - lib/shoulda/matchers/assertion_error.rb
272
+ - lib/shoulda/matchers/error.rb
273
+ - lib/shoulda/matchers/independent.rb
274
+ - lib/shoulda/matchers/independent/delegate_matcher.rb
275
+ - lib/shoulda/matchers/independent/delegate_matcher/stubbed_target.rb
276
+ - lib/shoulda/matchers/integrations/nunit_test_case_detection.rb
230
277
  - lib/shoulda/matchers/integrations/rspec.rb
231
278
  - lib/shoulda/matchers/integrations/test_unit.rb
232
279
  - lib/shoulda/matchers/rails_shim.rb
233
280
  - lib/shoulda/matchers/version.rb
281
+ - lib/shoulda/matchers/warn.rb
234
282
  - shoulda-matchers.gemspec
283
+ - spec/shoulda/matchers/action_controller/callback_matcher_spec.rb
235
284
  - spec/shoulda/matchers/action_controller/filter_param_matcher_spec.rb
236
285
  - spec/shoulda/matchers/action_controller/redirect_to_matcher_spec.rb
237
286
  - spec/shoulda/matchers/action_controller/render_template_matcher_spec.rb
@@ -242,6 +291,7 @@ files:
242
291
  - spec/shoulda/matchers/action_controller/route_params_spec.rb
243
292
  - spec/shoulda/matchers/action_controller/set_session_matcher_spec.rb
244
293
  - spec/shoulda/matchers/action_controller/set_the_flash_matcher_spec.rb
294
+ - spec/shoulda/matchers/action_controller/strong_parameters_matcher_spec.rb
245
295
  - spec/shoulda/matchers/active_model/allow_mass_assignment_of_matcher_spec.rb
246
296
  - spec/shoulda/matchers/active_model/allow_value_matcher_spec.rb
247
297
  - spec/shoulda/matchers/active_model/disallow_value_matcher_spec.rb
@@ -252,7 +302,8 @@ files:
252
302
  - spec/shoulda/matchers/active_model/have_secure_password_matcher_spec.rb
253
303
  - spec/shoulda/matchers/active_model/helpers_spec.rb
254
304
  - spec/shoulda/matchers/active_model/numericality_matchers/comparison_matcher_spec.rb
255
- - spec/shoulda/matchers/active_model/numericality_matchers/odd_even_number_matcher_spec.rb
305
+ - spec/shoulda/matchers/active_model/numericality_matchers/even_number_matcher_spec.rb
306
+ - spec/shoulda/matchers/active_model/numericality_matchers/odd_number_matcher_spec.rb
256
307
  - spec/shoulda/matchers/active_model/numericality_matchers/only_integer_matcher_spec.rb
257
308
  - spec/shoulda/matchers/active_model/validate_absence_of_matcher_spec.rb
258
309
  - spec/shoulda/matchers/active_model/validate_acceptance_of_matcher_spec.rb
@@ -268,47 +319,57 @@ files:
268
319
  - spec/shoulda/matchers/active_record/have_db_index_matcher_spec.rb
269
320
  - spec/shoulda/matchers/active_record/have_readonly_attributes_matcher_spec.rb
270
321
  - spec/shoulda/matchers/active_record/serialize_matcher_spec.rb
322
+ - spec/shoulda/matchers/independent/delegate_matcher/stubbed_target_spec.rb
323
+ - spec/shoulda/matchers/independent/delegate_matcher_spec.rb
271
324
  - spec/spec_helper.rb
272
325
  - spec/support/active_model_versions.rb
273
326
  - spec/support/active_resource_builder.rb
274
327
  - spec/support/activemodel_helpers.rb
328
+ - spec/support/capture_helpers.rb
275
329
  - spec/support/class_builder.rb
276
330
  - spec/support/controller_builder.rb
331
+ - spec/support/fail_with_message_including_matcher.rb
277
332
  - spec/support/fail_with_message_matcher.rb
278
333
  - spec/support/i18n_faker.rb
279
334
  - spec/support/mailer_builder.rb
280
335
  - spec/support/model_builder.rb
281
336
  - spec/support/rails_versions.rb
282
- - spec/support/shared_examples/numerical_submatcher_spec.rb
337
+ - spec/support/shared_examples/numerical_submatcher.rb
338
+ - spec/support/shared_examples/numerical_type_submatcher.rb
283
339
  - spec/support/test_application.rb
284
340
  homepage: http://thoughtbot.com/community/
285
341
  licenses:
286
342
  - MIT
287
- metadata: {}
288
343
  post_install_message:
289
344
  rdoc_options: []
290
345
  require_paths:
291
346
  - lib
292
347
  required_ruby_version: !ruby/object:Gem::Requirement
348
+ none: false
293
349
  requirements:
294
- - - '>='
350
+ - - ! '>='
295
351
  - !ruby/object:Gem::Version
296
352
  version: 1.9.2
297
353
  required_rubygems_version: !ruby/object:Gem::Requirement
354
+ none: false
298
355
  requirements:
299
- - - '>='
356
+ - - ! '>='
300
357
  - !ruby/object:Gem::Version
301
358
  version: '0'
359
+ segments:
360
+ - 0
361
+ hash: 3861964174441044757
302
362
  requirements: []
303
363
  rubyforge_project:
304
- rubygems_version: 2.0.14
364
+ rubygems_version: 1.8.23
305
365
  signing_key:
306
- specification_version: 4
366
+ specification_version: 3
307
367
  summary: Making tests easy on the fingers and eyes
308
368
  test_files:
309
369
  - features/rails_integration.feature
310
370
  - features/step_definitions/rails_steps.rb
311
371
  - features/support/env.rb
372
+ - spec/shoulda/matchers/action_controller/callback_matcher_spec.rb
312
373
  - spec/shoulda/matchers/action_controller/filter_param_matcher_spec.rb
313
374
  - spec/shoulda/matchers/action_controller/redirect_to_matcher_spec.rb
314
375
  - spec/shoulda/matchers/action_controller/render_template_matcher_spec.rb
@@ -319,6 +380,7 @@ test_files:
319
380
  - spec/shoulda/matchers/action_controller/route_params_spec.rb
320
381
  - spec/shoulda/matchers/action_controller/set_session_matcher_spec.rb
321
382
  - spec/shoulda/matchers/action_controller/set_the_flash_matcher_spec.rb
383
+ - spec/shoulda/matchers/action_controller/strong_parameters_matcher_spec.rb
322
384
  - spec/shoulda/matchers/active_model/allow_mass_assignment_of_matcher_spec.rb
323
385
  - spec/shoulda/matchers/active_model/allow_value_matcher_spec.rb
324
386
  - spec/shoulda/matchers/active_model/disallow_value_matcher_spec.rb
@@ -329,7 +391,8 @@ test_files:
329
391
  - spec/shoulda/matchers/active_model/have_secure_password_matcher_spec.rb
330
392
  - spec/shoulda/matchers/active_model/helpers_spec.rb
331
393
  - spec/shoulda/matchers/active_model/numericality_matchers/comparison_matcher_spec.rb
332
- - spec/shoulda/matchers/active_model/numericality_matchers/odd_even_number_matcher_spec.rb
394
+ - spec/shoulda/matchers/active_model/numericality_matchers/even_number_matcher_spec.rb
395
+ - spec/shoulda/matchers/active_model/numericality_matchers/odd_number_matcher_spec.rb
333
396
  - spec/shoulda/matchers/active_model/numericality_matchers/only_integer_matcher_spec.rb
334
397
  - spec/shoulda/matchers/active_model/validate_absence_of_matcher_spec.rb
335
398
  - spec/shoulda/matchers/active_model/validate_acceptance_of_matcher_spec.rb
@@ -345,16 +408,21 @@ test_files:
345
408
  - spec/shoulda/matchers/active_record/have_db_index_matcher_spec.rb
346
409
  - spec/shoulda/matchers/active_record/have_readonly_attributes_matcher_spec.rb
347
410
  - spec/shoulda/matchers/active_record/serialize_matcher_spec.rb
411
+ - spec/shoulda/matchers/independent/delegate_matcher/stubbed_target_spec.rb
412
+ - spec/shoulda/matchers/independent/delegate_matcher_spec.rb
348
413
  - spec/spec_helper.rb
349
414
  - spec/support/active_model_versions.rb
350
415
  - spec/support/active_resource_builder.rb
351
416
  - spec/support/activemodel_helpers.rb
417
+ - spec/support/capture_helpers.rb
352
418
  - spec/support/class_builder.rb
353
419
  - spec/support/controller_builder.rb
420
+ - spec/support/fail_with_message_including_matcher.rb
354
421
  - spec/support/fail_with_message_matcher.rb
355
422
  - spec/support/i18n_faker.rb
356
423
  - spec/support/mailer_builder.rb
357
424
  - spec/support/model_builder.rb
358
425
  - spec/support/rails_versions.rb
359
- - spec/support/shared_examples/numerical_submatcher_spec.rb
426
+ - spec/support/shared_examples/numerical_submatcher.rb
427
+ - spec/support/shared_examples/numerical_type_submatcher.rb
360
428
  - spec/support/test_application.rb