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.
- checksums.yaml +4 -4
- data/.yardopts +3 -1
- data/Gemfile +1 -2
- data/Gemfile.lock +8 -2
- data/NEWS.md +29 -1
- data/README.md +3 -11
- data/doc_config/yard/templates/default/fulldoc/html/css/global.css +17 -0
- data/doc_config/yard/templates/default/fulldoc/html/css/style.css +3 -4
- data/doc_config/yard/templates/default/layout/html/breadcrumb.erb +1 -1
- data/doc_config/yard/templates/default/layout/html/footer.erb +6 -0
- data/docs/errors/NonCaseSwappableValueError.md +111 -0
- data/gemfiles/4.0.0.gemfile +1 -2
- data/gemfiles/4.0.0.gemfile.lock +5 -2
- data/gemfiles/4.0.1.gemfile +1 -2
- data/gemfiles/4.0.1.gemfile.lock +5 -2
- data/gemfiles/4.1.gemfile +1 -2
- data/gemfiles/4.1.gemfile.lock +5 -2
- data/gemfiles/4.2.gemfile +1 -2
- data/gemfiles/4.2.gemfile.lock +5 -2
- data/lib/shoulda/matchers/action_controller/respond_with_matcher.rb +1 -5
- data/lib/shoulda/matchers/active_model/allow_value_matcher.rb +26 -4
- data/lib/shoulda/matchers/active_model/numericality_matchers/comparison_matcher.rb +9 -8
- data/lib/shoulda/matchers/active_model/numericality_matchers/even_number_matcher.rb +14 -8
- data/lib/shoulda/matchers/active_model/numericality_matchers/numeric_type_matcher.rb +47 -12
- data/lib/shoulda/matchers/active_model/numericality_matchers/odd_number_matcher.rb +15 -9
- data/lib/shoulda/matchers/active_model/numericality_matchers/only_integer_matcher.rb +14 -7
- data/lib/shoulda/matchers/active_model/validate_inclusion_of_matcher.rb +16 -4
- data/lib/shoulda/matchers/active_model/validate_numericality_of_matcher.rb +67 -5
- data/lib/shoulda/matchers/active_record/validate_uniqueness_of_matcher.rb +35 -0
- data/lib/shoulda/matchers/util.rb +2 -0
- data/lib/shoulda/matchers/util/word_wrap.rb +178 -0
- data/lib/shoulda/matchers/version.rb +1 -1
- data/lib/shoulda/matchers/warn.rb +1 -10
- data/spec/acceptance_spec_helper.rb +2 -10
- data/spec/doublespeak_spec_helper.rb +1 -17
- data/spec/spec_helper.rb +23 -0
- data/spec/unit/shoulda/matchers/active_model/numericality_matchers/comparison_matcher_spec.rb +1 -1
- data/spec/unit/shoulda/matchers/active_model/numericality_matchers/even_number_matcher_spec.rb +5 -2
- data/spec/unit/shoulda/matchers/active_model/numericality_matchers/odd_number_matcher_spec.rb +5 -2
- data/spec/unit/shoulda/matchers/active_model/numericality_matchers/only_integer_matcher_spec.rb +5 -1
- data/spec/unit/shoulda/matchers/active_model/validate_inclusion_of_matcher_spec.rb +91 -4
- data/spec/unit/shoulda/matchers/active_model/validate_numericality_of_matcher_spec.rb +292 -2
- data/spec/unit/shoulda/matchers/active_record/validate_uniqueness_of_matcher_spec.rb +16 -2
- data/spec/unit/shoulda/matchers/util/word_wrap_spec.rb +197 -0
- data/spec/unit_spec_helper.rb +1 -16
- data/tasks/documentation.rb +10 -17
- metadata +9 -2
data/spec/unit_spec_helper.rb
CHANGED
@@ -16,26 +16,13 @@ ENV['RAILS_ENV'] = 'test'
|
|
16
16
|
require 'rspec/rails'
|
17
17
|
require 'shoulda-matchers'
|
18
18
|
|
19
|
-
|
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
|
data/tasks/documentation.rb
CHANGED
@@ -39,29 +39,22 @@ module Shoulda
|
|
39
39
|
|
40
40
|
project_directory = File.expand_path(File.dirname(__FILE__) + "/..")
|
41
41
|
|
42
|
-
regenerate_docs =
|
42
|
+
regenerate_docs = proc do
|
43
43
|
print 'Regenerating docs... '
|
44
|
-
system('bundle exec yard doc &>/dev/null')
|
45
|
-
|
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(®enerate_docs)
|
54
|
-
update(®enerate_docs)
|
55
|
-
end
|
56
|
-
|
57
|
-
path File.join(project_directory, 'doc_config/yard') do
|
58
|
-
glob '**/*.rb'
|
59
|
-
create(®enerate_docs)
|
60
|
-
update(®enerate_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(®enerate_docs)
|
66
59
|
update(®enerate_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.
|
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-
|
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
|