shoulda-matchers 2.6.0 → 2.6.1.rc1

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 (52) hide show
  1. data/Gemfile.lock +1 -1
  2. data/NEWS.md +34 -0
  3. data/README.md +14 -0
  4. data/features/activemodel_integration.feature +15 -0
  5. data/features/step_definitions/activemodel_steps.rb +21 -0
  6. data/gemfiles/3.0.gemfile.lock +1 -1
  7. data/gemfiles/3.1.gemfile.lock +1 -1
  8. data/gemfiles/3.2.gemfile.lock +1 -1
  9. data/gemfiles/4.0.0.gemfile.lock +1 -1
  10. data/gemfiles/4.0.1.gemfile.lock +1 -1
  11. data/gemfiles/4.1.gemfile.lock +1 -1
  12. data/lib/shoulda/matchers.rb +1 -0
  13. data/lib/shoulda/matchers/action_controller/callback_matcher.rb +11 -6
  14. data/lib/shoulda/matchers/action_controller/strong_parameters_matcher.rb +59 -95
  15. data/lib/shoulda/matchers/active_model/allow_value_matcher.rb +10 -18
  16. data/lib/shoulda/matchers/active_model/disallow_value_matcher.rb +10 -0
  17. data/lib/shoulda/matchers/active_model/ensure_inclusion_of_matcher.rb +60 -18
  18. data/lib/shoulda/matchers/active_model/errors.rb +9 -7
  19. data/lib/shoulda/matchers/active_model/numericality_matchers/comparison_matcher.rb +4 -0
  20. data/lib/shoulda/matchers/active_model/validate_presence_of_matcher.rb +24 -5
  21. data/lib/shoulda/matchers/doublespeak.rb +27 -0
  22. data/lib/shoulda/matchers/doublespeak/double.rb +74 -0
  23. data/lib/shoulda/matchers/doublespeak/double_collection.rb +54 -0
  24. data/lib/shoulda/matchers/doublespeak/double_implementation_registry.rb +27 -0
  25. data/lib/shoulda/matchers/doublespeak/object_double.rb +32 -0
  26. data/lib/shoulda/matchers/doublespeak/proxy_implementation.rb +30 -0
  27. data/lib/shoulda/matchers/doublespeak/structs.rb +8 -0
  28. data/lib/shoulda/matchers/doublespeak/stub_implementation.rb +34 -0
  29. data/lib/shoulda/matchers/doublespeak/world.rb +38 -0
  30. data/lib/shoulda/matchers/independent/delegate_matcher.rb +112 -61
  31. data/lib/shoulda/matchers/integrations/test_unit.rb +8 -6
  32. data/lib/shoulda/matchers/rails_shim.rb +16 -0
  33. data/lib/shoulda/matchers/version.rb +1 -1
  34. data/spec/shoulda/matchers/action_controller/callback_matcher_spec.rb +22 -19
  35. data/spec/shoulda/matchers/action_controller/strong_parameters_matcher_spec.rb +174 -65
  36. data/spec/shoulda/matchers/active_model/allow_value_matcher_spec.rb +14 -0
  37. data/spec/shoulda/matchers/active_model/ensure_inclusion_of_matcher_spec.rb +553 -211
  38. data/spec/shoulda/matchers/active_model/numericality_matchers/comparison_matcher_spec.rb +6 -0
  39. data/spec/shoulda/matchers/active_model/validate_numericality_of_matcher_spec.rb +22 -0
  40. data/spec/shoulda/matchers/active_model/validate_presence_of_matcher_spec.rb +23 -4
  41. data/spec/shoulda/matchers/doublespeak/double_collection_spec.rb +102 -0
  42. data/spec/shoulda/matchers/doublespeak/double_implementation_registry_spec.rb +21 -0
  43. data/spec/shoulda/matchers/doublespeak/double_spec.rb +144 -0
  44. data/spec/shoulda/matchers/doublespeak/object_double_spec.rb +77 -0
  45. data/spec/shoulda/matchers/doublespeak/proxy_implementation_spec.rb +40 -0
  46. data/spec/shoulda/matchers/doublespeak/stub_implementation_spec.rb +88 -0
  47. data/spec/shoulda/matchers/doublespeak/world_spec.rb +88 -0
  48. data/spec/shoulda/matchers/doublespeak_spec.rb +19 -0
  49. data/spec/shoulda/matchers/independent/delegate_matcher_spec.rb +105 -39
  50. data/spec/support/controller_builder.rb +18 -9
  51. data/spec/support/rails_versions.rb +4 -0
  52. metadata +34 -8
@@ -10,6 +10,10 @@ module RailsVersions
10
10
  def rails_4_x?
11
11
  Gem::Requirement.new('~> 4.0').satisfied_by?(rails_version)
12
12
  end
13
+
14
+ def rails_gte_41?
15
+ Gem::Requirement.new('>= 4.1').satisfied_by?(rails_version)
16
+ end
13
17
  end
14
18
 
15
19
  RSpec.configure do |config|
metadata CHANGED
@@ -1,8 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shoulda-matchers
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.0
5
- prerelease:
4
+ version: 2.6.1.rc1
5
+ prerelease: 6
6
6
  platform: ruby
7
7
  authors:
8
8
  - Tammer Saleh
@@ -14,7 +14,7 @@ authors:
14
14
  autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
- date: 2014-04-12 00:00:00.000000000 Z
17
+ date: 2014-04-22 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: activesupport
@@ -198,7 +198,9 @@ files:
198
198
  - NEWS.md
199
199
  - README.md
200
200
  - Rakefile
201
+ - features/activemodel_integration.feature
201
202
  - features/rails_integration.feature
203
+ - features/step_definitions/activemodel_steps.rb
202
204
  - features/step_definitions/rails_steps.rb
203
205
  - features/support/env.rb
204
206
  - gemfiles/3.0.gemfile
@@ -269,6 +271,15 @@ files:
269
271
  - lib/shoulda/matchers/active_record/have_readonly_attribute_matcher.rb
270
272
  - lib/shoulda/matchers/active_record/serialize_matcher.rb
271
273
  - lib/shoulda/matchers/assertion_error.rb
274
+ - lib/shoulda/matchers/doublespeak.rb
275
+ - lib/shoulda/matchers/doublespeak/double.rb
276
+ - lib/shoulda/matchers/doublespeak/double_collection.rb
277
+ - lib/shoulda/matchers/doublespeak/double_implementation_registry.rb
278
+ - lib/shoulda/matchers/doublespeak/object_double.rb
279
+ - lib/shoulda/matchers/doublespeak/proxy_implementation.rb
280
+ - lib/shoulda/matchers/doublespeak/structs.rb
281
+ - lib/shoulda/matchers/doublespeak/stub_implementation.rb
282
+ - lib/shoulda/matchers/doublespeak/world.rb
272
283
  - lib/shoulda/matchers/error.rb
273
284
  - lib/shoulda/matchers/independent.rb
274
285
  - lib/shoulda/matchers/independent/delegate_matcher.rb
@@ -319,6 +330,14 @@ files:
319
330
  - spec/shoulda/matchers/active_record/have_db_index_matcher_spec.rb
320
331
  - spec/shoulda/matchers/active_record/have_readonly_attributes_matcher_spec.rb
321
332
  - spec/shoulda/matchers/active_record/serialize_matcher_spec.rb
333
+ - spec/shoulda/matchers/doublespeak/double_collection_spec.rb
334
+ - spec/shoulda/matchers/doublespeak/double_implementation_registry_spec.rb
335
+ - spec/shoulda/matchers/doublespeak/double_spec.rb
336
+ - spec/shoulda/matchers/doublespeak/object_double_spec.rb
337
+ - spec/shoulda/matchers/doublespeak/proxy_implementation_spec.rb
338
+ - spec/shoulda/matchers/doublespeak/stub_implementation_spec.rb
339
+ - spec/shoulda/matchers/doublespeak/world_spec.rb
340
+ - spec/shoulda/matchers/doublespeak_spec.rb
322
341
  - spec/shoulda/matchers/independent/delegate_matcher/stubbed_target_spec.rb
323
342
  - spec/shoulda/matchers/independent/delegate_matcher_spec.rb
324
343
  - spec/spec_helper.rb
@@ -353,12 +372,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
353
372
  required_rubygems_version: !ruby/object:Gem::Requirement
354
373
  none: false
355
374
  requirements:
356
- - - ! '>='
375
+ - - ! '>'
357
376
  - !ruby/object:Gem::Version
358
- version: '0'
359
- segments:
360
- - 0
361
- hash: 3861964174441044757
377
+ version: 1.3.1
362
378
  requirements: []
363
379
  rubyforge_project:
364
380
  rubygems_version: 1.8.23
@@ -366,7 +382,9 @@ signing_key:
366
382
  specification_version: 3
367
383
  summary: Making tests easy on the fingers and eyes
368
384
  test_files:
385
+ - features/activemodel_integration.feature
369
386
  - features/rails_integration.feature
387
+ - features/step_definitions/activemodel_steps.rb
370
388
  - features/step_definitions/rails_steps.rb
371
389
  - features/support/env.rb
372
390
  - spec/shoulda/matchers/action_controller/callback_matcher_spec.rb
@@ -408,6 +426,14 @@ test_files:
408
426
  - spec/shoulda/matchers/active_record/have_db_index_matcher_spec.rb
409
427
  - spec/shoulda/matchers/active_record/have_readonly_attributes_matcher_spec.rb
410
428
  - spec/shoulda/matchers/active_record/serialize_matcher_spec.rb
429
+ - spec/shoulda/matchers/doublespeak/double_collection_spec.rb
430
+ - spec/shoulda/matchers/doublespeak/double_implementation_registry_spec.rb
431
+ - spec/shoulda/matchers/doublespeak/double_spec.rb
432
+ - spec/shoulda/matchers/doublespeak/object_double_spec.rb
433
+ - spec/shoulda/matchers/doublespeak/proxy_implementation_spec.rb
434
+ - spec/shoulda/matchers/doublespeak/stub_implementation_spec.rb
435
+ - spec/shoulda/matchers/doublespeak/world_spec.rb
436
+ - spec/shoulda/matchers/doublespeak_spec.rb
411
437
  - spec/shoulda/matchers/independent/delegate_matcher/stubbed_target_spec.rb
412
438
  - spec/shoulda/matchers/independent/delegate_matcher_spec.rb
413
439
  - spec/spec_helper.rb