shoulda-matchers 3.0.0 → 3.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +3 -1
  3. data/Gemfile +1 -2
  4. data/Gemfile.lock +8 -2
  5. data/NEWS.md +29 -1
  6. data/README.md +3 -11
  7. data/doc_config/yard/templates/default/fulldoc/html/css/global.css +17 -0
  8. data/doc_config/yard/templates/default/fulldoc/html/css/style.css +3 -4
  9. data/doc_config/yard/templates/default/layout/html/breadcrumb.erb +1 -1
  10. data/doc_config/yard/templates/default/layout/html/footer.erb +6 -0
  11. data/docs/errors/NonCaseSwappableValueError.md +111 -0
  12. data/gemfiles/4.0.0.gemfile +1 -2
  13. data/gemfiles/4.0.0.gemfile.lock +5 -2
  14. data/gemfiles/4.0.1.gemfile +1 -2
  15. data/gemfiles/4.0.1.gemfile.lock +5 -2
  16. data/gemfiles/4.1.gemfile +1 -2
  17. data/gemfiles/4.1.gemfile.lock +5 -2
  18. data/gemfiles/4.2.gemfile +1 -2
  19. data/gemfiles/4.2.gemfile.lock +5 -2
  20. data/lib/shoulda/matchers/action_controller/respond_with_matcher.rb +1 -5
  21. data/lib/shoulda/matchers/active_model/allow_value_matcher.rb +26 -4
  22. data/lib/shoulda/matchers/active_model/numericality_matchers/comparison_matcher.rb +9 -8
  23. data/lib/shoulda/matchers/active_model/numericality_matchers/even_number_matcher.rb +14 -8
  24. data/lib/shoulda/matchers/active_model/numericality_matchers/numeric_type_matcher.rb +47 -12
  25. data/lib/shoulda/matchers/active_model/numericality_matchers/odd_number_matcher.rb +15 -9
  26. data/lib/shoulda/matchers/active_model/numericality_matchers/only_integer_matcher.rb +14 -7
  27. data/lib/shoulda/matchers/active_model/validate_inclusion_of_matcher.rb +16 -4
  28. data/lib/shoulda/matchers/active_model/validate_numericality_of_matcher.rb +67 -5
  29. data/lib/shoulda/matchers/active_record/validate_uniqueness_of_matcher.rb +35 -0
  30. data/lib/shoulda/matchers/util.rb +2 -0
  31. data/lib/shoulda/matchers/util/word_wrap.rb +178 -0
  32. data/lib/shoulda/matchers/version.rb +1 -1
  33. data/lib/shoulda/matchers/warn.rb +1 -10
  34. data/spec/acceptance_spec_helper.rb +2 -10
  35. data/spec/doublespeak_spec_helper.rb +1 -17
  36. data/spec/spec_helper.rb +23 -0
  37. data/spec/unit/shoulda/matchers/active_model/numericality_matchers/comparison_matcher_spec.rb +1 -1
  38. data/spec/unit/shoulda/matchers/active_model/numericality_matchers/even_number_matcher_spec.rb +5 -2
  39. data/spec/unit/shoulda/matchers/active_model/numericality_matchers/odd_number_matcher_spec.rb +5 -2
  40. data/spec/unit/shoulda/matchers/active_model/numericality_matchers/only_integer_matcher_spec.rb +5 -1
  41. data/spec/unit/shoulda/matchers/active_model/validate_inclusion_of_matcher_spec.rb +91 -4
  42. data/spec/unit/shoulda/matchers/active_model/validate_numericality_of_matcher_spec.rb +292 -2
  43. data/spec/unit/shoulda/matchers/active_record/validate_uniqueness_of_matcher_spec.rb +16 -2
  44. data/spec/unit/shoulda/matchers/util/word_wrap_spec.rb +197 -0
  45. data/spec/unit_spec_helper.rb +1 -16
  46. data/tasks/documentation.rb +10 -17
  47. metadata +9 -2
@@ -16,26 +16,13 @@ ENV['RAILS_ENV'] = 'test'
16
16
  require 'rspec/rails'
17
17
  require 'shoulda-matchers'
18
18
 
19
- PROJECT_ROOT = File.expand_path('../..', __FILE__)
20
- $LOAD_PATH << File.join(PROJECT_ROOT, 'lib')
19
+ require 'spec_helper'
21
20
 
22
21
  Dir[ File.join(File.expand_path('../support/unit/**/*.rb', __FILE__)) ].sort.each do |file|
23
22
  require file
24
23
  end
25
24
 
26
25
  RSpec.configure do |config|
27
- config.order = :random
28
-
29
- config.expect_with :rspec do |c|
30
- c.syntax = :expect
31
- end
32
-
33
- if config.files_to_run.one?
34
- config.default_formatter = 'doc'
35
- end
36
-
37
- config.mock_with :rspec
38
-
39
26
  if config.respond_to?(:infer_spec_type_from_file_location!)
40
27
  config.infer_spec_type_from_file_location!
41
28
  end
@@ -69,5 +56,3 @@ Shoulda::Matchers.configure do |config|
69
56
  with.library :rails
70
57
  end
71
58
  end
72
-
73
- $VERBOSE = true
@@ -39,29 +39,22 @@ module Shoulda
39
39
 
40
40
  project_directory = File.expand_path(File.dirname(__FILE__) + "/..")
41
41
 
42
- regenerate_docs = -> (base, relative) {
42
+ regenerate_docs = proc do
43
43
  print 'Regenerating docs... '
44
- system('bundle exec yard doc &>/dev/null')
45
- puts 'done!'
46
- }
44
+ if system('bundle exec yard doc &>/dev/null')
45
+ puts 'done!'
46
+ else
47
+ print "\nCould not regenerate docs!!"
48
+ end
49
+ end
50
+
51
+ regenerate_docs.call
47
52
 
48
53
  puts 'Waiting for documentation files to change...'
49
54
 
50
55
  FSSM.monitor do
51
56
  path project_directory do
52
- glob 'README.md'
53
- create(&regenerate_docs)
54
- update(&regenerate_docs)
55
- end
56
-
57
- path File.join(project_directory, 'doc_config/yard') do
58
- glob '**/*.rb'
59
- create(&regenerate_docs)
60
- update(&regenerate_docs)
61
- end
62
-
63
- path File.join(project_directory, 'lib') do
64
- glob '**/*.rb'
57
+ glob '{README.md,NEWS.md,.yardopts,docs/**/*.md,doc_config/yard/**/*.{rb,js,css,erb},lib/**/*.rb}'
65
58
  create(&regenerate_docs)
66
59
  update(&regenerate_docs)
67
60
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shoulda-matchers
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tammer Saleh
@@ -14,7 +14,7 @@ authors:
14
14
  autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
- date: 2015-10-01 00:00:00.000000000 Z
17
+ date: 2015-10-23 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: activesupport
@@ -66,11 +66,13 @@ files:
66
66
  - doc_config/yard/templates/default/fulldoc/html/setup.rb
67
67
  - doc_config/yard/templates/default/layout/html/breadcrumb.erb
68
68
  - doc_config/yard/templates/default/layout/html/fonts.erb
69
+ - doc_config/yard/templates/default/layout/html/footer.erb
69
70
  - doc_config/yard/templates/default/layout/html/layout.erb
70
71
  - doc_config/yard/templates/default/layout/html/search.erb
71
72
  - doc_config/yard/templates/default/layout/html/setup.rb
72
73
  - doc_config/yard/templates/default/method_details/html/source.erb
73
74
  - doc_config/yard/templates/default/module/html/box_info.erb
75
+ - docs/errors/NonCaseSwappableValueError.md
74
76
  - gemfiles/4.0.0.gemfile
75
77
  - gemfiles/4.0.0.gemfile.lock
76
78
  - gemfiles/4.0.1.gemfile
@@ -186,6 +188,7 @@ files:
186
188
  - lib/shoulda/matchers/rails_shim.rb
187
189
  - lib/shoulda/matchers/routing.rb
188
190
  - lib/shoulda/matchers/util.rb
191
+ - lib/shoulda/matchers/util/word_wrap.rb
189
192
  - lib/shoulda/matchers/version.rb
190
193
  - lib/shoulda/matchers/warn.rb
191
194
  - script/SUPPORTED_VERSIONS
@@ -201,6 +204,7 @@ files:
201
204
  - spec/acceptance_spec_helper.rb
202
205
  - spec/doublespeak_spec_helper.rb
203
206
  - spec/report_warnings.rb
207
+ - spec/spec_helper.rb
204
208
  - spec/support/acceptance/adds_shoulda_matchers_to_project.rb
205
209
  - spec/support/acceptance/helpers.rb
206
210
  - spec/support/acceptance/helpers/active_model_helpers.rb
@@ -306,6 +310,7 @@ files:
306
310
  - spec/unit/shoulda/matchers/independent/delegate_method_matcher/stubbed_target_spec.rb
307
311
  - spec/unit/shoulda/matchers/independent/delegate_method_matcher_spec.rb
308
312
  - spec/unit/shoulda/matchers/routing/route_matcher_spec.rb
313
+ - spec/unit/shoulda/matchers/util/word_wrap_spec.rb
309
314
  - spec/unit_spec_helper.rb
310
315
  - spec/warnings_spy.rb
311
316
  - spec/warnings_spy/filesystem.rb
@@ -345,6 +350,7 @@ test_files:
345
350
  - spec/acceptance_spec_helper.rb
346
351
  - spec/doublespeak_spec_helper.rb
347
352
  - spec/report_warnings.rb
353
+ - spec/spec_helper.rb
348
354
  - spec/support/acceptance/adds_shoulda_matchers_to_project.rb
349
355
  - spec/support/acceptance/helpers.rb
350
356
  - spec/support/acceptance/helpers/active_model_helpers.rb
@@ -450,6 +456,7 @@ test_files:
450
456
  - spec/unit/shoulda/matchers/independent/delegate_method_matcher/stubbed_target_spec.rb
451
457
  - spec/unit/shoulda/matchers/independent/delegate_method_matcher_spec.rb
452
458
  - spec/unit/shoulda/matchers/routing/route_matcher_spec.rb
459
+ - spec/unit/shoulda/matchers/util/word_wrap_spec.rb
453
460
  - spec/unit_spec_helper.rb
454
461
  - spec/warnings_spy.rb
455
462
  - spec/warnings_spy/filesystem.rb