shoulda-matchers 4.3.0 → 4.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +157 -77
  3. data/lib/shoulda/matchers.rb +13 -12
  4. data/lib/shoulda/matchers/action_controller.rb +13 -13
  5. data/lib/shoulda/matchers/active_model.rb +15 -26
  6. data/lib/shoulda/matchers/active_model/allow_value_matcher.rb +9 -0
  7. data/lib/shoulda/matchers/active_model/numericality_matchers.rb +5 -0
  8. data/lib/shoulda/matchers/active_model/numericality_matchers/comparison_matcher.rb +5 -1
  9. data/lib/shoulda/matchers/active_model/validate_inclusion_of_matcher.rb +2 -21
  10. data/lib/shoulda/matchers/active_model/validate_length_of_matcher.rb +27 -3
  11. data/lib/shoulda/matchers/active_model/validate_numericality_of_matcher.rb +32 -0
  12. data/lib/shoulda/matchers/active_model/validation_matcher.rb +27 -0
  13. data/lib/shoulda/matchers/active_record.rb +13 -23
  14. data/lib/shoulda/matchers/active_record/association_matcher.rb +20 -4
  15. data/lib/shoulda/matchers/active_record/association_matchers.rb +12 -0
  16. data/lib/shoulda/matchers/active_record/association_matchers/join_table_matcher.rb +2 -2
  17. data/lib/shoulda/matchers/active_record/association_matchers/model_reflection.rb +12 -6
  18. data/lib/shoulda/matchers/active_record/association_matchers/model_reflector.rb +20 -3
  19. data/lib/shoulda/matchers/active_record/have_attached_matcher.rb +147 -0
  20. data/lib/shoulda/matchers/active_record/have_implicit_order_column.rb +106 -0
  21. data/lib/shoulda/matchers/active_record/have_secure_token_matcher.rb +28 -9
  22. data/lib/shoulda/matchers/active_record/uniqueness.rb +5 -5
  23. data/lib/shoulda/matchers/active_record/validate_uniqueness_of_matcher.rb +2 -2
  24. data/lib/shoulda/matchers/doublespeak.rb +8 -7
  25. data/lib/shoulda/matchers/independent.rb +0 -2
  26. data/lib/shoulda/matchers/independent/delegate_method_matcher.rb +3 -0
  27. data/lib/shoulda/matchers/integrations.rb +6 -6
  28. data/lib/shoulda/matchers/integrations/test_frameworks.rb +4 -2
  29. data/lib/shoulda/matchers/rails_shim.rb +4 -0
  30. data/lib/shoulda/matchers/util.rb +9 -4
  31. data/lib/shoulda/matchers/util/word_wrap.rb +1 -1
  32. data/lib/shoulda/matchers/version.rb +1 -1
  33. metadata +8 -8
  34. data/MIT-LICENSE +0 -22
  35. data/lib/shoulda/matchers/independent/delegate_method_matcher/stubbed_target.rb +0 -37
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c022366c394fe10215171aee752452d41f7e051ef0174b99e0d9f947486ac1f7
4
- data.tar.gz: 38bc2bf3e4d8432ebc8a8c1bfb319fc1da9236699e1ec28d78b53d93621c96c2
3
+ metadata.gz: 50d63f547edcfe3f040aff155386def4cf30b3b17befc2e24a3b29f9933d6aba
4
+ data.tar.gz: dc7066ab2357ddda9efe73ab7bfd547dae0a2b6c3180a4d68d3fb715708af500
5
5
  SHA512:
6
- metadata.gz: e06ce93032d5612eb34c952eb310f199b718e35875ae31c84ae177a09ca2bbdcc5fe33cc8fc3a97f5bf77aa3c5e2c91e3f7596e8c6328c66e494c8a9f3a94d90
7
- data.tar.gz: 10f26b7b206227be842077802b9da370775b198cf30f32e8df70fa1b1bb69cbddd831244071eab874d98e186c6abee7a8c11187015f65b8f1f570b47ba20e947
6
+ metadata.gz: a112316adba7fa8458cc8b4aa404152cf3618705f232002dddc7b1004f99f69a9717961d4893cfaff50e7d802ae30ea7837e70104bc4a497c9b560982ab80831
7
+ data.tar.gz: a732f1d0039ad911f35ee9f1d05a4cac8683232b253b42a59a8d6409ed285e292213bca8680e4c627f9fbd7ff27ba85dcc5d67a42885d571462456c385ec635a
data/README.md CHANGED
@@ -22,10 +22,10 @@ complex, and error-prone.
22
22
  ## Quick links
23
23
 
24
24
  📖 **[Read the documentation for the latest version][rubydocs].**
25
- 📢 **[See what's changed in a recent version][news].**
25
+ 📢 **[See what's changed in recent versions][changelog].**
26
26
 
27
27
  [rubydocs]: http://matchers.shoulda.io/docs
28
- [news]: NEWS.md
28
+ [changelog]: CHANGELOG.md
29
29
 
30
30
  ## Table of contents
31
31
 
@@ -41,10 +41,12 @@ complex, and error-prone.
41
41
  * [ActiveRecord matchers](#activerecord-matchers)
42
42
  * [ActionController matchers](#actioncontroller-matchers)
43
43
  * [Independent matchers](#independent-matchers)
44
- * [Compatibility](#compatibility)
44
+ * [Extensions](#extensions)
45
45
  * [Contributing](#contributing)
46
+ * [Compatibility](#compatibility)
46
47
  * [Versioning](#versioning)
47
- * [License](#license)
48
+ * [Team](#team)
49
+ * [Copyright/License](#copyright-license)
48
50
  * [About thoughtbot](#about-thoughtbot)
49
51
 
50
52
  ## Getting started
@@ -55,21 +57,21 @@ Start by including `shoulda-matchers` in your Gemfile:
55
57
 
56
58
  ```ruby
57
59
  group :test do
58
- gem 'shoulda-matchers'
60
+ gem 'shoulda-matchers', '~> 4.0'
59
61
  end
60
62
  ```
61
63
 
62
- Now you need to tell the gem a couple of things:
64
+ Then run `bundle install`.
63
65
 
64
- * Which test framework you're using
65
- * Which portion of the matchers you want to use
66
+ Now you need to configure the gem by telling it:
66
67
 
67
- You can supply this information by providing a configuration block. Where this
68
- goes and what this contains depends on your project.
68
+ * which matchers you want to use in your tests
69
+ * that you're using RSpec so that it can make those matchers available in
70
+ your example groups
69
71
 
70
72
  #### Rails apps
71
73
 
72
- Assuming you are testing a Rails app, simply place this at the bottom of
74
+ If you're working on a Rails app, simply place this at the bottom of
73
75
  `spec/rails_helper.rb` (or in a support file if you so choose):
74
76
 
75
77
  ```ruby
@@ -81,13 +83,12 @@ Shoulda::Matchers.configure do |config|
81
83
  end
82
84
  ```
83
85
 
84
- Now you're ready to [use matchers in your tests](#usage)!
85
-
86
86
  #### Non-Rails apps
87
87
 
88
- If your project isn't a Rails app, but you still make use of ActiveRecord or
89
- ActiveModel, you can still use this gem too! In that case, you'll want to place
90
- the following configuration at the bottom of `spec/spec_helper.rb`:
88
+ If you're not working on a Rails app, but you still make use of ActiveRecord or
89
+ ActiveModel in your project, you can still use this gem too! In that case,
90
+ you'll want to place the following configuration at the bottom of
91
+ `spec/spec_helper.rb`:
91
92
 
92
93
  ```ruby
93
94
  Shoulda::Matchers.configure do |config|
@@ -101,45 +102,83 @@ Shoulda::Matchers.configure do |config|
101
102
  end
102
103
  ```
103
104
 
104
- Now you're ready to [use matchers in your tests](#usage)!
105
-
106
105
  ### Minitest
107
106
 
108
- Shoulda Matchers was originally a component of [Shoulda][shoulda], a gem that
109
- also provides `should` and `context` syntax via
110
- [`shoulda-context`][shoulda-context].
107
+ If you're using our umbrella gem [Shoulda], then make sure that you're using the
108
+ latest version:
109
+
110
+ ```ruby
111
+ group :test do
112
+ gem 'shoulda', '~> 4.0'
113
+ end
114
+ ```
111
115
 
112
- [shoulda]: https://github.com/thoughtbot/shoulda
113
- [shoulda-context]: https://github.com/thoughtbot/shoulda-context
116
+ [Shoulda]: https://github.com/thoughtbot/shoulda
114
117
 
115
- At the moment, `shoulda` has not been updated to support `shoulda-matchers` 3.x
116
- and 4.x, so you'll want to add the following to your Gemfile:
118
+ Otherwise, add `shoulda-matchers` to your Gemfile:
117
119
 
118
120
  ```ruby
119
121
  group :test do
120
- gem 'shoulda', '~> 3.5'
121
- gem 'shoulda-matchers', '~> 2.0'
122
- gem 'rails-controller-testing'
122
+ gem 'shoulda-matchers', '~> 4.0'
123
123
  end
124
124
  ```
125
125
 
126
- Now you're ready to [use matchers in your tests](#usage)!
126
+ Then run `bundle install`.
127
+
128
+ Now you need to configure the gem by telling it:
129
+
130
+ * which matchers you want to use in your tests
131
+ * that you're using Minitest so that it can make those matchers available in
132
+ your test case classes
133
+
134
+ #### Rails apps
135
+
136
+ If you're working on a Rails app, simply place this at the bottom of
137
+ `test/test_helper.rb`:
138
+
139
+ ```ruby
140
+ Shoulda::Matchers.configure do |config|
141
+ config.integrate do |with|
142
+ with.test_framework :minitest
143
+ with.library :rails
144
+ end
145
+ end
146
+ ```
147
+
148
+ #### Non-Rails apps
149
+
150
+ If you're not working on a Rails app, but you still make use of ActiveRecord or
151
+ ActiveModel in your project, you can still use this gem too! In that case,
152
+ you'll want to place the following configuration at the bottom of
153
+ `test/test_helper.rb`:
154
+
155
+ ```ruby
156
+ Shoulda::Matchers.configure do |config|
157
+ config.integrate do |with|
158
+ with.test_framework :minitest
159
+
160
+ # Keep as many of these lines as are necessary:
161
+ with.library :active_record
162
+ with.library :active_model
163
+ end
164
+ end
165
+ ```
127
166
 
128
167
  ## Usage
129
168
 
130
- The matchers provided by this gem are divided into different categories
131
- depending on what you're testing within your Rails app:
169
+ Most of the matchers provided by this gem are useful in a Rails context, and as
170
+ such, can be used for different parts of a Rails app:
132
171
 
133
172
  * [database models backed by ActiveRecord](#activemodel-matchers)
134
173
  * [non-database models, form objects, etc. backed by
135
174
  ActiveModel](#activerecord-matchers)
136
175
  * [controllers](#actioncontroller-matchers)
137
176
  * [routes](#routing-matchers) (RSpec only)
138
- * [usage of Rails-specific features like `delegate`](#independent-matchers)
177
+ * [Rails-specific features like `delegate`](#independent-matchers)
139
178
 
140
- All matchers are designed to be prepended primarily with the word `should`,
141
- which is a special directive in both RSpec and Shoulda. For instance, a model
142
- test case may look something like:
179
+ As the name of the gem indicates, most matchers are designed to be used in
180
+ "one-liner" form using the `should` macro, a special directive available in both
181
+ RSpec and [Shoulda]. For instance, a model test case may look something like:
143
182
 
144
183
  ``` ruby
145
184
  # RSpec
@@ -167,16 +206,17 @@ class MenuItemTest < ActiveSupport::TestCase
167
206
  end
168
207
  ```
169
208
 
170
- For the full set of matchers you can use, [see below](#matchers).
209
+ [See below](#matchers) for the full set of matchers that you can use.
171
210
 
172
211
  ### On the subject of `subject`
173
212
 
174
213
  For both RSpec and Shoulda, the **subject** is an implicit reference to the
175
- object under test, and all of the matchers make use of it internally when they
176
- are run. This is always set automatically by your test framework in any given
177
- test case; however, in certain cases it can be advantageous to override the
178
- subject. For instance, when testing validations in a model, it is customary to
179
- provide a valid model instead of a fresh one:
214
+ object under test, and through the use of `should` as demonstrated above, all of
215
+ the matchers make use of `subject` internally when they are run. A `subject` is
216
+ always set automatically by your test framework in any given test case; however,
217
+ in certain cases it can be advantageous to override it. For instance, when
218
+ testing validations in a model, it is customary to provide a valid model instead
219
+ of a fresh one:
180
220
 
181
221
  ``` ruby
182
222
  # RSpec
@@ -234,11 +274,19 @@ end
234
274
 
235
275
  ### Availability of RSpec matchers in example groups
236
276
 
277
+ #### Rails projects
278
+
237
279
  If you're using RSpec, then you're probably familiar with the concept of example
238
- groups: these are different kinds of test cases, and each of them has special
239
- behavior around them. As alluded to [above](#usage), this gem works in a similar
240
- way, and there are matchers that are only available in certain types of example
241
- groups:
280
+ groups. Example groups can be assigned tags order to assign different behavior
281
+ to different kinds of example groups. This comes into play especially when using
282
+ `rspec-rails`, where, for instance, controller example groups, tagged with
283
+ `type: :controller`, are written differently than request example groups, tagged
284
+ with `type: :request`. This difference in writing style arises because
285
+ `rspec-rails` mixes different behavior and methods into controller example
286
+ groups vs. request example groups.
287
+
288
+ Relying on this behavior, Shoulda Matchers automatically makes certain matchers
289
+ available in certain kinds of example groups:
242
290
 
243
291
  * ActiveRecord and ActiveModel matchers are available only in model example
244
292
  groups, i.e., those tagged with `type: :model` or in files located under
@@ -250,13 +298,27 @@ groups:
250
298
  tagged with `type: :routing` or in files located under `spec/routing`.
251
299
  * Independent matchers are available in all example groups.
252
300
 
253
- As long as you're using Rails, you don't need to worry about this everything
254
- should "just work".
301
+ As long as you're using Rails, you don't need to worry about these details
302
+ everything should "just work".
303
+
304
+ #### Non-Rails projects
305
+
306
+ **What if you are using ActiveModel or ActiveRecord outside of Rails, however,
307
+ and you want to use model matchers in a certain example group?** Then you'll
308
+ need to manually include the module that holds those matchers into that example
309
+ group. For instance, you might have to say:
255
310
 
256
- **However, if you are using ActiveModel or ActiveRecord outside of Rails**, and
257
- you want to use model matchers in certain example groups, you'll need to
258
- manually include the module that holds those matchers. A good way to do this is
259
- to place the following in your `spec_helper.rb`:
311
+ ``` ruby
312
+ RSpec.describe MySpecialModel do
313
+ include Shoulda::Matchers::ActiveModel
314
+ include Shoulda::Matchers::ActiveRecord
315
+ end
316
+ ```
317
+
318
+ If you have a lot of similar example groups in which you need to do this, then
319
+ you might find it more helpful to tag your example groups appropriately, then
320
+ instruct RSpec to mix these modules into any example groups that have that tag.
321
+ For instance, you could add this to your `rails_helper.rb`:
260
322
 
261
323
  ```ruby
262
324
  RSpec.configure do |config|
@@ -265,21 +327,20 @@ RSpec.configure do |config|
265
327
  end
266
328
  ```
267
329
 
268
- Then you can say:
330
+ And from then on, you could say:
269
331
 
270
332
  ```ruby
271
- describe MySpecialModel, type: :model do
333
+ RSpec.describe MySpecialModel, type: :model do
272
334
  # ...
273
335
  end
274
336
  ```
275
337
 
276
338
  ### `should` vs `is_expected.to`
277
339
 
278
- In this README and throughout the documentation, we're using the `should` form
279
- of RSpec's one-liner syntax over `is_expected.to`. The `should` form works
280
- regardless of how you've configured RSpec meaning you can still use it even
281
- when using the `expect` syntax. But if you prefer to use `is_expected.to`, you
282
- can do that too:
340
+ In this README and throughout the documentation, you'll notice that we use the
341
+ `should` form of RSpec's one-liner syntax over `is_expected.to`. Beside being
342
+ the namesake of the gem itself, this is our preferred syntax as it's short and
343
+ sweet. But if you prefer to use `is_expected.to`, you can do that too:
283
344
 
284
345
  ```ruby
285
346
  RSpec.describe Person, type: :model do
@@ -289,7 +350,7 @@ end
289
350
 
290
351
  ## Matchers
291
352
 
292
- The following is a list of matchers shipped with the gem. If you need details
353
+ Here is the full list of matchers that ship with this gem. If you need details
293
354
  about any of them, make sure to [consult the documentation][rubydocs]!
294
355
 
295
356
  ### ActiveModel matchers
@@ -330,10 +391,16 @@ about any of them, make sure to [consult the documentation][rubydocs]!
330
391
  tests that the table that backs your model has a specific column.
331
392
  * **[have_db_index](lib/shoulda/matchers/active_record/have_db_index_matcher.rb)**
332
393
  tests that the table that backs your model has an index on a specific column.
394
+ * **[have_implicit_order_column](lib/shoulda/matchers/active_record/have_implicit_order_column.rb)**
395
+ tests usage of `implicit_order_column`.
333
396
  * **[have_many](lib/shoulda/matchers/active_record/association_matcher.rb)**
334
397
  tests your `has_many` associations.
398
+ * **[have_many_attached](lib/shoulda/matchers/active_record/have_attached_matcher.rb)**
399
+ tests your `has_many_attached` associations.
335
400
  * **[have_one](lib/shoulda/matchers/active_record/association_matcher.rb)**
336
401
  tests your `has_one` associations.
402
+ * **[have_one_attached](lib/shoulda/matchers/active_record/have_attached_matcher.rb)**
403
+ tests your `has_one_attached` associations.
337
404
  * **[have_readonly_attribute](lib/shoulda/matchers/active_record/have_readonly_attribute_matcher.rb)**
338
405
  tests usage of the `attr_readonly` macro.
339
406
  * **[have_rich_text](lib/shoulda/matchers/active_record/have_rich_text_matcher.rb)**
@@ -383,37 +450,51 @@ about any of them, make sure to [consult the documentation][rubydocs]!
383
450
  tests that an object forwards messages to other, internal objects by way of
384
451
  delegation.
385
452
 
386
- ## Compatibility
453
+ ## Extensions
387
454
 
388
- Shoulda Matchers is tested and supported against Ruby 2.4+, Rails 5.x, Rails
389
- 4.2.x, RSpec 3.x, and Minitest 5.x.
455
+ Over time our community has created extensions to Shoulda Matchers. If you've
456
+ created something that you want to share, please [let us know][new-issue]!
390
457
 
391
- For Ruby < 2.4 and Rails < 4.1 compatibility, please use [v3.1.3][v3.1.3].
458
+ * **[shoulda-matchers-cucumber]** Adds support for using Shoulda Matchers in
459
+ Cucumber tests.
392
460
 
393
- [v3.1.3]: https://github.com/thoughtbot/shoulda-matchers/releases/tag/v3.1.3
461
+ [new-issue]: https://github.com/thoughtbot/shoulda-matchers/issues/new
462
+ [shoulda-matchers-cucumber]: https://github.com/majioa/shoulda-matchers-cucumber
394
463
 
395
464
  ## Contributing
396
465
 
397
- Shoulda Matchers is open source, and we are grateful for
398
- [everyone][contributors] who's contributed so far.
466
+ Have a fix for a problem you've been running into or an idea for a new feature
467
+ you think would be useful? Take a look at the [Contributing
468
+ document](CONTRIBUTING.md) for instructions on setting up the repo on your
469
+ machine, understanding the codebase, and creating a good pull request.
399
470
 
400
- [contributors]: https://github.com/thoughtbot/shoulda-matchers/contributors
471
+ ## Compatibility
401
472
 
402
- If you'd like to contribute, please take a look at the
403
- [instructions](CONTRIBUTING.md) for installing dependencies and crafting a good
404
- pull request.
473
+ Shoulda Matchers is [tested][travis] and supported against Ruby 2.4+, Rails
474
+ 4.2+, RSpec 3.x, and Minitest 5.x.
475
+
476
+ For Ruby < 2.4 and Rails < 4.1 compatibility, please use [v3.1.3][v3.1.3].
477
+
478
+ [v3.1.3]: https://github.com/thoughtbot/shoulda-matchers/tree/v3.1.3
405
479
 
406
480
  ## Versioning
407
481
 
408
482
  Shoulda Matchers follows Semantic Versioning 2.0 as defined at
409
483
  <http://semver.org>.
410
484
 
411
- ## License
485
+ ## Team
486
+
487
+ Shoulda Matchers is maintained by [Elliot Winkler][mcmire] and [Gui
488
+ Albuk][guialbuk].
489
+
490
+ [mcmire]: https://github.com/mcmire
491
+ [guialbuk]: https://github.com/guialbuk
492
+
493
+ ## Copyright/License
412
494
 
413
- Shoulda Matchers is copyright © 2006-2020
414
- [thoughtbot, inc][thoughtbot-website]. It is free software,
415
- and may be redistributed under the terms specified in the
416
- [MIT-LICENSE](MIT-LICENSE) file.
495
+ Shoulda Matchers is copyright © 2006-2020 Tammer Saleh and [thoughtbot,
496
+ inc][thoughtbot-website]. It is free and opensource software and may be
497
+ redistributed under the terms specified in the [LICENSE](LICENSE) file.
417
498
 
418
499
  [thoughtbot-website]: https://thoughtbot.com
419
500
 
@@ -423,8 +504,7 @@ and may be redistributed under the terms specified in the
423
504
 
424
505
  [thoughtbot-logo]: https://presskit.thoughtbot.com/images/thoughtbot-logo-for-readmes.svg
425
506
 
426
- Shoulda Matchers is maintained and funded by thoughtbot, inc. The names and
427
- logos for thoughtbot are trademarks of thoughtbot, inc.
507
+ The names and logos for thoughtbot are trademarks of thoughtbot, inc.
428
508
 
429
509
  We are passionate about open source software. See [our other
430
510
  projects][community]. We are [available for hire][hire].
@@ -1,21 +1,22 @@
1
1
  require 'shoulda/matchers/configuration'
2
- require 'shoulda/matchers/doublespeak'
3
- require 'shoulda/matchers/error'
4
- require 'shoulda/matchers/independent'
5
- require 'shoulda/matchers/integrations'
6
- require 'shoulda/matchers/matcher_context'
7
- require 'shoulda/matchers/rails_shim'
8
- require 'shoulda/matchers/util'
9
2
  require 'shoulda/matchers/version'
10
3
  require 'shoulda/matchers/warn'
11
4
 
12
- require 'shoulda/matchers/action_controller'
13
- require 'shoulda/matchers/active_model'
14
- require 'shoulda/matchers/active_record'
15
- require 'shoulda/matchers/routing'
16
-
17
5
  module Shoulda
18
6
  module Matchers
7
+ autoload :ActionController, 'shoulda/matchers/action_controller'
8
+ autoload :ActiveModel, 'shoulda/matchers/active_model'
9
+ autoload :ActiveRecord, 'shoulda/matchers/active_record'
10
+ autoload :Doublespeak, 'shoulda/matchers/doublespeak'
11
+ autoload :Error, 'shoulda/matchers/error'
12
+ autoload :Independent, 'shoulda/matchers/independent'
13
+ autoload :Integrations, 'shoulda/matchers/integrations'
14
+ autoload :MatcherContext, 'shoulda/matchers/matcher_context'
15
+ autoload :RailsShim, 'shoulda/matchers/rails_shim'
16
+ autoload :Routing, 'shoulda/matchers/routing'
17
+ autoload :Util, 'shoulda/matchers/util'
18
+ autoload :WordWrap, 'shoulda/matchers/util/word_wrap'
19
+
19
20
  class << self
20
21
  # @private
21
22
  attr_accessor :assertion_exception_class
@@ -1,24 +1,24 @@
1
- require 'shoulda/matchers/action_controller/filter_param_matcher'
2
- require 'shoulda/matchers/action_controller/route_params'
3
- require 'shoulda/matchers/action_controller/set_flash_matcher'
4
- require 'shoulda/matchers/action_controller/render_with_layout_matcher'
5
1
  require 'shoulda/matchers/action_controller/respond_with_matcher'
6
- require 'shoulda/matchers/action_controller/set_session_matcher'
7
2
  require 'shoulda/matchers/action_controller/route_matcher'
8
- require 'shoulda/matchers/action_controller/redirect_to_matcher'
9
- require 'shoulda/matchers/action_controller/render_template_matcher'
10
- require 'shoulda/matchers/action_controller/rescue_from_matcher'
11
- require 'shoulda/matchers/action_controller/callback_matcher'
12
- require 'shoulda/matchers/action_controller/permit_matcher'
13
- require 'shoulda/matchers/action_controller/set_session_or_flash_matcher'
14
- require 'shoulda/matchers/action_controller/flash_store'
15
- require 'shoulda/matchers/action_controller/session_store'
16
3
 
17
4
  module Shoulda
18
5
  module Matchers
19
6
  # This module provides matchers that are used to test behavior within
20
7
  # controllers.
21
8
  module ActionController
9
+ autoload :CallbackMatcher, 'shoulda/matchers/action_controller/callback_matcher'
10
+ autoload :FlashStore, 'shoulda/matchers/action_controller/flash_store'
11
+ autoload :FilterParamMatcher, 'shoulda/matchers/action_controller/filter_param_matcher'
12
+ autoload :PermitMatcher, 'shoulda/matchers/action_controller/permit_matcher'
13
+ autoload :RedirectToMatcher, 'shoulda/matchers/action_controller/redirect_to_matcher'
14
+ autoload :RenderTemplateMatcher, 'shoulda/matchers/action_controller/render_template_matcher'
15
+ autoload :RenderWithLayoutMatcher, 'shoulda/matchers/action_controller/render_with_layout_matcher'
16
+ autoload :RescueFromMatcher, 'shoulda/matchers/action_controller/rescue_from_matcher'
17
+ autoload :RouteParams, 'shoulda/matchers/action_controller/route_params'
18
+ autoload :SessionStore, 'shoulda/matchers/action_controller/session_store'
19
+ autoload :SetFlashMatcher, 'shoulda/matchers/action_controller/set_flash_matcher'
20
+ autoload :SetSessionMatcher, 'shoulda/matchers/action_controller/set_session_matcher'
21
+ autoload :SetSessionOrFlashMatcher, 'shoulda/matchers/action_controller/set_session_or_flash_matcher'
22
22
  end
23
23
  end
24
24
  end