unidom-common-rspec 0.9 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6f097e72d01cc1632058b1f840918b13b8699b27
4
- data.tar.gz: 88122fdb2b5ef945dc9168dc2b03ab180b878472
3
+ metadata.gz: 3e28568165c67bc6f4aa46a5e162f3fdc4b2558b
4
+ data.tar.gz: e3621f4fe0cbd2ad0c3614f88443893e91d1bc0c
5
5
  SHA512:
6
- metadata.gz: f25e70951fc961ef8354ebf52926b9207d9051c716f4b9505f6666610c9b127d0a544e96bea4dc089295609581d78d008425576a598a67f1f5a0203bf5431401
7
- data.tar.gz: a6537d558ed74092157e7f0d4ff64aa722b6793d115d7063a63d6f22e03d86942da0cdcfca397b52a9abbfc215c5e43e8561d57122307d16756bb6bb5fd05218
6
+ metadata.gz: 4c6c1a846436b66b8009a05ca4be54939ba5ee4f44547d877f802251454b9a6b2f94bf36fa21f57a521155b7fdb0c2060479cf37058960a79f4616092f811bac
7
+ data.tar.gz: 3fee500adaed6ba6910d2488354639c5322d9df93251db2b3c8847b82db7e594a9ad8e54194a687dc11c7edb7606aadc827b60609313185606b7effed12f3470
data/CHANGELOG.md CHANGED
@@ -31,7 +31,7 @@
31
31
  1. Each Validator shared examples
32
32
 
33
33
  ## v0.7.1
34
- 1. Improved the Model Extension shared examples for the ``ordinal_is`` scope, the .grade_is scope, the .grade_higher_than scope, the .grade_lower_than scope, the .priority_is scope, the .priority_higher_than scope, & the .priority_lower_than scope
34
+ 1. Improved the Model Extension shared examples for the ``ordinal_is`` scope, the ``grade_is`` scope, the .grade_higher_than scope, the .grade_lower_than scope, the .priority_is scope, the .priority_higher_than scope, & the .priority_lower_than scope
35
35
  2. Improved the Model Extension shared examples for the #ordinal validation
36
36
 
37
37
  ## v0.7.2
@@ -44,3 +44,6 @@
44
44
  ## v0.9
45
45
  1. Validates Text shared examples
46
46
  2. Validates Numericality shared examples
47
+
48
+ ## v0.9.1
49
+ 1. Improve the Validates Text shared examples for the length
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- unidom-common-rspec (0.8)
4
+ unidom-common-rspec (0.9)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/ROADMAP.md CHANGED
@@ -31,7 +31,7 @@
31
31
  1. Each Validator shared examples
32
32
 
33
33
  ## v0.7.1
34
- 1. Improve the Model Extension shared examples for the ``ordinal_is`` scope, the .grade_is scope, the .grade_higher_than scope, the .grade_lower_than scope, the .priority_is scope, the .priority_higher_than scope, & the .priority_lower_than scope
34
+ 1. Improve the Model Extension shared examples for the ``ordinal_is`` scope, the ``grade_is`` scope, the .grade_higher_than scope, the .grade_lower_than scope, the .priority_is scope, the .priority_higher_than scope, & the .priority_lower_than scope
35
35
  2. Improve the Model Extension shared examples for the #ordinal validation
36
36
 
37
37
  ## v0.7.2
@@ -44,3 +44,9 @@
44
44
  ## v0.9
45
45
  1. Validates Text shared examples
46
46
  2. Validates Numericality shared examples
47
+
48
+ ## v0.9.1
49
+ 1. Improve the Validates Text shared examples for the length
50
+
51
+ ## v0.10
52
+ 1. Assert Present shared examples
@@ -60,13 +60,20 @@ shared_examples 'validates text' do |model_attributes, attribute_name, options|
60
60
  symbols = '~`!@#$%^&*()-_=+{}[];:"\',.<>/?\\|'.chars
61
61
  chars = numbers+letters+symbols
62
62
 
63
- chars.each do |c| attributes_collection[ { attribute_name => c } ] = 0 end if 1==minimum_length
64
- chars.each do |c| attributes_collection[ { attribute_name => c*(minimum_length-1) } ] = 1 end if minimum_length>1
65
- chars.each do |c| attributes_collection[ { attribute_name => c*minimum_length } ] = 0 end
66
- chars.each do |c| attributes_collection[ { attribute_name => c*(minimum_length+1) } ] = 0 end if minimum_length<maximum_length
67
- chars.each do |c| attributes_collection[ { attribute_name => c*(maximum_length-1) } ] = 0 end
68
- chars.each do |c| attributes_collection[ { attribute_name => c*maximum_length } ] = 0 end
69
- chars.each do |c| attributes_collection[ { attribute_name => c*(maximum_length+1) } ] = 1 end
63
+ if minimum_length==maximum_length
64
+ length = maximum_length
65
+ chars.each do |c| attributes_collection[ { attribute_name => c*(length-1) } ] = 1 end
66
+ chars.each do |c| attributes_collection[ { attribute_name => c*length } ] = 0 end
67
+ chars.each do |c| attributes_collection[ { attribute_name => c*(length+1) } ] = 1 end
68
+ else
69
+ chars.each do |c| attributes_collection[ { attribute_name => c } ] = 0 end if 1==minimum_length
70
+ chars.each do |c| attributes_collection[ { attribute_name => c*(minimum_length-1) } ] = 1 end if minimum_length>1
71
+ chars.each do |c| attributes_collection[ { attribute_name => c*minimum_length } ] = 0 end
72
+ chars.each do |c| attributes_collection[ { attribute_name => c*(minimum_length+1) } ] = 0 end if minimum_length<maximum_length
73
+ chars.each do |c| attributes_collection[ { attribute_name => c*(maximum_length-1) } ] = 0 end
74
+ chars.each do |c| attributes_collection[ { attribute_name => c*maximum_length } ] = 0 end
75
+ chars.each do |c| attributes_collection[ { attribute_name => c*(maximum_length+1) } ] = 1 end
76
+ end
70
77
 
71
78
  it_behaves_like 'validates', model_attributes, attribute_name, attributes_collection
72
79
 
@@ -1,7 +1,7 @@
1
1
  module Unidom
2
2
  module Common
3
3
  module RSpec
4
- VERSION = '0.9'
4
+ VERSION = '0.9.1'
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unidom-common-rspec
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.9'
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Topbit Du
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-03-13 00:00:00.000000000 Z
11
+ date: 2017-03-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec-rails