missing_validators 2.0.0 → 2.1.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 606dab4d74f885ca572168fef9a7315ef0c57c30
4
- data.tar.gz: c45673eabbc315352ba49d35e59420673be12c25
3
+ metadata.gz: 20d6955d8cea6660f0661b86c0c8bacc1c151c51
4
+ data.tar.gz: 23d7a1cb58094572414c1405852f2f9f4ec5f133
5
5
  SHA512:
6
- metadata.gz: 3d48da718a2afb2e6b74c1a12f534b8a3d726873ec889f77c29c0ab30bcb2767295bdabd7f0166b870530949810934fa1eaca256b95d8e3890a35d35e380e2c9
7
- data.tar.gz: 8b4880e80d5c3fa9e1ec7aad550d97d87ea6f5db2f494b4a0064cfc5b3bff01742c11114e1e338a7fb9ab13a39863b4f890fcdf5335946fbc9c17cda356817bb
6
+ metadata.gz: 216d03e00fbce2b8ac39556ae4ce2d8ff825607966a1df3397193ad5753f15d129865647563837f228751ade2bae2196cee4109ba1b868bc1dc5a89191714c94
7
+ data.tar.gz: 46100e5dc52c0e94675082ff9322b28195a417cd39fcf64b86a3783c500ef8cd6660853d46834b003b26946d85031bb22f137873d12136ecb6a879dfbb30f359
data/.travis.yml CHANGED
@@ -3,3 +3,6 @@ rvm:
3
3
  - 2.1.0
4
4
  - 2.0.0
5
5
  - 1.9.3
6
+ addons:
7
+ code_climate:
8
+ repo_token: 161aebec4183be79660c2f8b9d30dc6f1c03abbefd929aa856b296421629e3e2
data/README.md CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  [![Build Status](https://travis-ci.org/andrewgr/missing_validators.png)](https://travis-ci.org/andrewgr/missing_validators)
4
4
  [![Code Climate](https://codeclimate.com/github/andrewgr/missing_validators/badges/gpa.svg)](https://codeclimate.com/github/andrewgr/missing_validators)
5
+ [![Test Coverage](https://codeclimate.com/github/andrewgr/missing_validators/badges/coverage.svg)](https://codeclimate.com/github/andrewgr/missing_validators/coverage)
5
6
 
6
7
  MissingValidators is a collection of custom validators that are often required in Rails applications plus shoulda-style RSpec matchers to test the validation rules.
7
8
 
File without changes
@@ -16,7 +16,8 @@ class ImeiValidator < BaseValidator
16
16
  end
17
17
 
18
18
  def validate_luhn_checksum(numbers)
19
- sum, i = 0, 0
19
+ sum = 0
20
+ i = 0
20
21
 
21
22
  numbers.each_char do |ch|
22
23
  n = ch.to_i
@@ -1,5 +1,5 @@
1
1
  # Collection of custom validators that are often required in Rails apps.
2
2
  module MissingValidators
3
3
  # Gem version
4
- VERSION = '2.0.0'
4
+ VERSION = '2.1.0'
5
5
  end
@@ -19,3 +19,5 @@ if defined?(RSpec)
19
19
  require 'missing_validators/matchers/ensure_valid_mac_address_format_of'
20
20
  require 'missing_validators/matchers/ensure_valid_imei_format_of'
21
21
  end
22
+
23
+ I18n.load_path << File.expand_path('../locales/en.yml', __FILE__)
@@ -20,10 +20,9 @@ Gem::Specification.new do |gem|
20
20
  gem.add_runtime_dependency 'activesupport'
21
21
  gem.add_runtime_dependency 'addressable', '~> 2.3'
22
22
 
23
- gem.add_development_dependency 'rspec', '~> 3'
23
+ gem.add_development_dependency 'rspec', '~> 3.2'
24
24
  gem.add_development_dependency 'rubocop', '~> 0.30'
25
25
  gem.add_development_dependency 'cane', '~> 2.6', '>= 2.6.1'
26
- gem.add_development_dependency 'shoulda', '~> 3.5'
27
26
  gem.add_development_dependency 'shoulda-matchers', '~> 2.8', '>= 2.8.0'
28
- gem.add_development_dependency 'codeclimate-test-reporter', '~> 0.4', '>= 0.4.7'
27
+ gem.add_development_dependency 'codeclimate-test-reporter', '~> 0.4'
29
28
  end
data/spec/spec_helper.rb CHANGED
@@ -3,7 +3,3 @@ CodeClimate::TestReporter.start
3
3
 
4
4
  require 'missing_validators'
5
5
  require 'shoulda/matchers'
6
- require 'shoulda/matchers/integrations/rspec'
7
-
8
- I18n.enforce_available_locales = false
9
- I18n.load_path << File.expand_path('../../config/locales/en.yml', __FILE__)
@@ -11,9 +11,9 @@ describe ColorValidator do
11
11
 
12
12
  subject { klass.new }
13
13
 
14
- it { should allow_value('#000000').for(:color) }
15
- it { should allow_value('#ab00FF').for(:color) }
14
+ it { is_expected.to allow_value('#000000').for(:color) }
15
+ it { is_expected.to allow_value('#ab00FF').for(:color) }
16
16
 
17
- it { should_not allow_value('kk').for(:color) }
18
- it { should_not allow_value(0).for(:color) }
17
+ it { is_expected.not_to allow_value('color').for(:color) }
18
+ it { is_expected.not_to allow_value(0).for(:color) }
19
19
  end
@@ -12,12 +12,12 @@ describe EmailValidator do
12
12
  end
13
13
  end
14
14
 
15
- it { should allow_value('super.user@example.com').for(:email) }
16
- it { should allow_value('super+user@example.com').for(:email) }
17
- it { should_not allow_value('user_example.com').for(:email) }
15
+ it { is_expected.to allow_value('super.user@example.com').for(:email) }
16
+ it { is_expected.to allow_value('super+user@example.com').for(:email) }
17
+ it { is_expected.not_to allow_value('user_example.com').for(:email) }
18
18
 
19
- it { should ensure_valid_email_format_of(:email) }
20
- it { should_not ensure_valid_email_format_of(:name) }
19
+ it { is_expected.to ensure_valid_email_format_of(:email) }
20
+ it { is_expected.not_to ensure_valid_email_format_of(:name) }
21
21
  end
22
22
 
23
23
  context 'email must be in the specific domain' do
@@ -30,8 +30,8 @@ describe EmailValidator do
30
30
  end
31
31
  end
32
32
 
33
- it { should allow_value('user@example.edu').for(:email) }
34
- it { should allow_value('user@example.com').for(:email) }
33
+ it { is_expected.to allow_value('user@example.edu').for(:email) }
34
+ it { is_expected.to allow_value('user@example.com').for(:email) }
35
35
  end
36
36
 
37
37
  context 'email domain is specified as string' do
@@ -43,8 +43,8 @@ describe EmailValidator do
43
43
  end
44
44
  end
45
45
 
46
- it { should allow_value('user@example.edu').for(:email) }
47
- it { should_not allow_value('user@example.com').for(:email) }
46
+ it { is_expected.to allow_value('user@example.edu').for(:email) }
47
+ it { is_expected.not_to allow_value('user@example.com').for(:email) }
48
48
  end
49
49
 
50
50
  context 'email domains are specified as an array of strings and symbols' do
@@ -52,18 +52,16 @@ describe EmailValidator do
52
52
  Class.new do
53
53
  include ActiveModel::Validations
54
54
  attr_accessor :email, :name
55
- validates :email, email: {
56
- domain: ['.com', '.edu', '.Com.Au', 'example.org']
57
- }
55
+ validates :email, email: { domain: %w(.com .edu .Com.Au example.org) }
58
56
  end
59
57
  end
60
58
 
61
- it { should allow_value('user@example.com').for(:email) }
62
- it { should allow_value('user@example.edu').for(:email) }
63
- it { should allow_value('user@example.org').for(:email) }
64
- it { should allow_value('user@example.com.au').for(:email) }
65
- it { should allow_value('user@example.Com.Au').for(:email) }
66
- it { should_not allow_value('user@example.net').for(:email) }
59
+ it { is_expected.to allow_value('user@example.com').for(:email) }
60
+ it { is_expected.to allow_value('user@example.edu').for(:email) }
61
+ it { is_expected.to allow_value('user@example.org').for(:email) }
62
+ it { is_expected.to allow_value('user@example.com.au').for(:email) }
63
+ it { is_expected.to allow_value('user@example.Com.Au').for(:email) }
64
+ it { is_expected.not_to allow_value('user@example.net').for(:email) }
67
65
  end
68
66
  end
69
67
  end
@@ -12,8 +12,8 @@ describe EqualityValidator do
12
12
  end
13
13
  end
14
14
 
15
- it { should allow_value('MOW').for(:origin) }
16
- it { should_not allow_value('NYC').for(:origin) }
15
+ it { is_expected.to allow_value('MOW').for(:origin) }
16
+ it { is_expected.not_to allow_value('NYC').for(:origin) }
17
17
  end
18
18
 
19
19
  describe do
@@ -11,27 +11,27 @@ describe ImeiValidator do
11
11
 
12
12
  subject { klass.new }
13
13
 
14
- it { should ensure_valid_imei_format_of(:imei) }
15
- it { should_not ensure_valid_imei_format_of(:name) }
14
+ it { is_expected.to ensure_valid_imei_format_of(:imei) }
15
+ it { is_expected.not_to ensure_valid_imei_format_of(:name) }
16
16
 
17
17
  context 'value is valid' do
18
- it { should allow_value(356_843_052_637_512).for(:imei) }
19
- it { should allow_value('356843052637512').for(:imei) }
20
- it { should allow_value('35-684305-2637512').for(:imei) }
21
- it { should allow_value('35-684305.263.7512').for(:imei) }
18
+ it { is_expected.to allow_value(356_843_052_637_512).for(:imei) }
19
+ it { is_expected.to allow_value('356843052637512').for(:imei) }
20
+ it { is_expected.to allow_value('35-684305-2637512').for(:imei) }
21
+ it { is_expected.to allow_value('35-684305.263.7512').for(:imei) }
22
22
  end
23
23
 
24
24
  context 'value too short' do
25
- it { should_not allow_value('3568430537512').for(:imei) }
26
- it { should_not allow_value('3').for(:imei) }
25
+ it { is_expected.not_to allow_value('3568430537512').for(:imei) }
26
+ it { is_expected.not_to allow_value('3').for(:imei) }
27
27
  end
28
28
 
29
29
  context 'value is too long' do
30
- it { should_not allow_value('35684305263751233').for(:imei) }
30
+ it { is_expected.not_to allow_value('35684305263751233').for(:imei) }
31
31
  end
32
32
 
33
33
  context 'luhn checksum does not match' do
34
- it { should_not allow_value('356843052637513').for(:imei) }
35
- it { should_not allow_value('156843052637512').for(:imei) }
34
+ it { is_expected.not_to allow_value('356843052637513').for(:imei) }
35
+ it { is_expected.not_to allow_value('156843052637512').for(:imei) }
36
36
  end
37
37
  end
@@ -12,8 +12,8 @@ describe InequalityValidator do
12
12
  end
13
13
  end
14
14
 
15
- it { should allow_value('valid value').for(:attr) }
16
- it { should_not allow_value('invalid value').for(:attr) }
15
+ it { is_expected.to allow_value('valid value').for(:attr) }
16
+ it { is_expected.not_to allow_value('invalid value').for(:attr) }
17
17
  end
18
18
 
19
19
  describe do
@@ -11,14 +11,14 @@ describe LatitudeValidator do
11
11
 
12
12
  subject { klass.new }
13
13
 
14
- it { should allow_value(-90).for(:lat) }
15
- it { should allow_value(90).for(:lat) }
16
- it { should allow_value(0).for(:lat) }
17
- it { should allow_value(9.33).for(:lat) }
14
+ it { is_expected.to allow_value(-90).for(:lat) }
15
+ it { is_expected.to allow_value(90).for(:lat) }
16
+ it { is_expected.to allow_value(0).for(:lat) }
17
+ it { is_expected.to allow_value(9.33).for(:lat) }
18
18
 
19
- it { should_not allow_value(-90.1).for(:lat) }
20
- it { should_not allow_value(90.1).for(:lat) }
19
+ it { is_expected.not_to allow_value(-90.1).for(:lat) }
20
+ it { is_expected.not_to allow_value(90.1).for(:lat) }
21
21
 
22
- it { should_not allow_value(nil).for(:lat) }
23
- it { should_not allow_value('').for(:lat) }
22
+ it { is_expected.not_to allow_value(nil).for(:lat) }
23
+ it { is_expected.not_to allow_value('').for(:lat) }
24
24
  end
@@ -11,14 +11,14 @@ describe LongitudeValidator do
11
11
 
12
12
  subject { klass.new }
13
13
 
14
- it { should allow_value(-180).for(:lon) }
15
- it { should allow_value(180).for(:lon) }
16
- it { should allow_value(0).for(:lon) }
17
- it { should allow_value(9.33).for(:lon) }
14
+ it { is_expected.to allow_value(-180).for(:lon) }
15
+ it { is_expected.to allow_value(180).for(:lon) }
16
+ it { is_expected.to allow_value(0).for(:lon) }
17
+ it { is_expected.to allow_value(9.33).for(:lon) }
18
18
 
19
- it { should_not allow_value(-181.1).for(:lon) }
20
- it { should_not allow_value(181.1).for(:lon) }
19
+ it { is_expected.not_to allow_value(-181.1).for(:lon) }
20
+ it { is_expected.not_to allow_value(181.1).for(:lon) }
21
21
 
22
- it { should_not allow_value(nil).for(:lon) }
23
- it { should_not allow_value('').for(:lon) }
22
+ it { is_expected.not_to allow_value(nil).for(:lon) }
23
+ it { is_expected.not_to allow_value('').for(:lon) }
24
24
  end
@@ -11,38 +11,43 @@ describe MacAddressValidator do
11
11
 
12
12
  subject { klass.new }
13
13
 
14
- it { should ensure_valid_mac_address_format_of(:mac) }
15
- it { should_not ensure_valid_mac_address_format_of(:name) }
16
-
17
- # Valid formats
18
- it { should allow_value('08:00:2b:01:02:03').for(:mac) }
19
- it { should allow_value('08-00-2B-01-02-03').for(:mac) }
20
- it { should allow_value('08.00.2b.01.02.03').for(:mac) }
21
- it { should allow_value('08 00 2B 01 02 03').for(:mac) }
22
- it { should allow_value('08002b:010203').for(:mac) }
23
- it { should allow_value('08002B.010203').for(:mac) }
24
- it { should allow_value('08002b-010203').for(:mac) }
25
- it { should allow_value('0800.2b01.0203').for(:mac) }
26
- it { should allow_value('0800-2B01-0203').for(:mac) }
27
- it { should allow_value('0800 2b01 0203').for(:mac) }
28
- it { should allow_value('08002b010203').for(:mac) }
29
-
30
- # Mixed Separators
31
- it { should_not allow_value('08-00:2b:01:02:03').for(:mac) }
32
- it { should_not allow_value('08.00:2b:01:02:03').for(:mac) }
33
- it { should_not allow_value('08 00:2b:01:02:03').for(:mac) }
34
- it { should_not allow_value('0800-2b01:0203').for(:mac) }
35
- it { should_not allow_value('0800 2B01:0203').for(:mac) }
36
-
37
- # Too Short
38
- it { should_not allow_value('08:00:2b:01:02').for(:mac) }
39
- it { should_not allow_value('08-00-2B-01-02').for(:mac) }
40
-
41
- # Too Long
42
- it { should_not allow_value('08:00:2b:01:02:03:04').for(:mac) }
43
-
44
- # Non-Hex Characters
45
- it { should_not allow_value('qq:00:00:00:00:00').for(:mac) }
46
-
47
- it { should_not allow_value('invalid').for(:mac) }
14
+ it { is_expected.to ensure_valid_mac_address_format_of(:mac) }
15
+ it { is_expected.not_to ensure_valid_mac_address_format_of(:name) }
16
+
17
+ context 'when MAC-address is valid' do
18
+ it { is_expected.to allow_value('08:00:2b:01:02:03').for(:mac) }
19
+ it { is_expected.to allow_value('08-00-2B-01-02-03').for(:mac) }
20
+ it { is_expected.to allow_value('08.00.2b.01.02.03').for(:mac) }
21
+ it { is_expected.to allow_value('08 00 2B 01 02 03').for(:mac) }
22
+ it { is_expected.to allow_value('08002b:010203').for(:mac) }
23
+ it { is_expected.to allow_value('08002B.010203').for(:mac) }
24
+ it { is_expected.to allow_value('08002b-010203').for(:mac) }
25
+ it { is_expected.to allow_value('0800.2b01.0203').for(:mac) }
26
+ it { is_expected.to allow_value('0800-2B01-0203').for(:mac) }
27
+ it { is_expected.to allow_value('0800 2b01 0203').for(:mac) }
28
+ it { is_expected.to allow_value('08002b010203').for(:mac) }
29
+ end
30
+
31
+ context 'when MAC-address uses different separators' do
32
+ it { is_expected.not_to allow_value('08-00:2b:01:02:03').for(:mac) }
33
+ it { is_expected.not_to allow_value('08.00:2b:01:02:03').for(:mac) }
34
+ it { is_expected.not_to allow_value('08 00:2b:01:02:03').for(:mac) }
35
+ it { is_expected.not_to allow_value('0800-2b01:0203').for(:mac) }
36
+ it { is_expected.not_to allow_value('0800 2B01:0203').for(:mac) }
37
+ end
38
+
39
+ context 'when MAC-address is too short' do
40
+ it { is_expected.not_to allow_value('08:00:2b:01:02').for(:mac) }
41
+ it { is_expected.not_to allow_value('08-00-2B-01-02').for(:mac) }
42
+ end
43
+
44
+ context 'when MAC-address is too long' do
45
+ it { is_expected.not_to allow_value('08:00:2b:01:02:03:04').for(:mac) }
46
+ end
47
+
48
+ context 'when MAC-address includes non-hex digits' do
49
+ it { is_expected.not_to allow_value('qq:00:00:00:00:00').for(:mac) }
50
+ end
51
+
52
+ it { is_expected.not_to allow_value('invalid').for(:mac) }
48
53
  end
@@ -12,29 +12,28 @@ describe UrlValidator do
12
12
 
13
13
  subject { klass.new }
14
14
 
15
- it { should ensure_valid_url_format_of(:url) }
16
- it { should_not ensure_valid_url_format_of(:name) }
17
-
18
- it { should allow_value('http://example.com').for(:url) }
19
- it { should allow_value('http://FooBar.cOm').for(:url) }
20
- it { should allow_value('http://foo.bar.baz.com').for(:url) }
21
- it { should allow_value('http://123.com').for(:url) }
22
- it { should allow_value('http://www.example.ru').for(:url) }
23
- it { should allow_value('http://user-example.co.uk').for(:url) }
24
- it { should allow_value('https://example.com').for(:url) }
25
- it { should allow_value('http://example.org/').for(:url) }
26
- it { should allow_value('https://example.net/index.html').for(:url) }
27
- it { should allow_value('http://example.net/login.php').for(:url) }
28
- it { should allow_value('https://example.travel/').for(:url) }
29
- it { should allow_value('http://example.aero').for(:url) }
30
- it { should allow_value('http://example.aero?foo=bar').for(:url) }
31
- it { should allow_value('http://user_example.com').for(:url) }
32
-
33
- it { should_not allow_value('http://user_examplecom').for(:url) }
34
- it { should_not allow_value('http://user example.com').for(:url) }
35
- it { should_not allow_value('http://user_example.a').for(:url) }
36
- it { should_not allow_value(':').for(:url) }
37
- it { should_not allow_value('.').for(:url) }
15
+ it { is_expected.to ensure_valid_url_format_of(:url) }
16
+ it { is_expected.not_to ensure_valid_url_format_of(:name) }
17
+
18
+ it { is_expected.to allow_value('http://example.com').for(:url) }
19
+ it { is_expected.to allow_value('http://FooBar.cOm').for(:url) }
20
+ it { is_expected.to allow_value('http://foo.bar.baz.com').for(:url) }
21
+ it { is_expected.to allow_value('http://123.com').for(:url) }
22
+ it { is_expected.to allow_value('http://www.example.ru').for(:url) }
23
+ it { is_expected.to allow_value('http://user-example.co.uk').for(:url) }
24
+ it { is_expected.to allow_value('https://example.com').for(:url) }
25
+ it { is_expected.to allow_value('http://example.org/').for(:url) }
26
+ it { is_expected.to allow_value('http://example.net/login.php').for(:url) }
27
+ it { is_expected.to allow_value('https://example.travel/').for(:url) }
28
+ it { is_expected.to allow_value('http://example.aero').for(:url) }
29
+ it { is_expected.to allow_value('http://example.aero?foo=bar').for(:url) }
30
+ it { is_expected.to allow_value('http://user_example.com').for(:url) }
31
+
32
+ it { is_expected.not_to allow_value('http://user_examplecom').for(:url) }
33
+ it { is_expected.not_to allow_value('http://user example.com').for(:url) }
34
+ it { is_expected.not_to allow_value('http://user_example.a').for(:url) }
35
+ it { is_expected.not_to allow_value(':').for(:url) }
36
+ it { is_expected.not_to allow_value('.').for(:url) }
38
37
  end
39
38
 
40
39
  describe 'url must be in a specific domain' do
@@ -49,14 +48,14 @@ describe UrlValidator do
49
48
 
50
49
  subject { klass.new }
51
50
 
52
- it { should allow_value('http://example.org').for(:url1) }
53
- it { should_not allow_value('http://example.com').for(:url1) }
51
+ it { is_expected.to allow_value('http://example.org').for(:url1) }
52
+ it { is_expected.not_to allow_value('http://example.com').for(:url1) }
54
53
 
55
- it { should allow_value('http://example.org').for(:url2) }
56
- it { should allow_value('http://example.edu').for(:url2) }
57
- it { should allow_value('http://example.com.au').for(:url2) }
58
- it { should allow_value('http://example.Com.Au').for(:url2) }
59
- it { should_not allow_value('http://example.com').for(:url2) }
54
+ it { is_expected.to allow_value('http://example.org').for(:url2) }
55
+ it { is_expected.to allow_value('http://example.edu').for(:url2) }
56
+ it { is_expected.to allow_value('http://example.com.au').for(:url2) }
57
+ it { is_expected.to allow_value('http://example.Com.Au').for(:url2) }
58
+ it { is_expected.not_to allow_value('http://example.com').for(:url2) }
60
59
  end
61
60
 
62
61
  describe 'url must be domain root' do
@@ -71,14 +70,14 @@ describe UrlValidator do
71
70
 
72
71
  subject { klass.new }
73
72
 
74
- it { should allow_value('http://example.org').for(:url1) }
75
- it { should allow_value('http://example.org/').for(:url1) }
76
- it { should_not allow_value('http://example.com/test').for(:url1) }
77
- it { should_not allow_value('http://example.com/#fragment').for(:url1) }
78
- it { should_not allow_value('http://example.com/?key=value').for(:url1) }
73
+ it { is_expected.to allow_value('http://example.org').for(:url1) }
74
+ it { is_expected.to allow_value('http://example.org/').for(:url1) }
75
+ it { is_expected.not_to allow_value('http://example.com/test').for(:url1) }
76
+ it { is_expected.not_to allow_value('http://example.com/#abc').for(:url1) }
77
+ it { is_expected.not_to allow_value('http://example.com/?k=v').for(:url1) }
79
78
 
80
- it { should allow_value('http://example.org').for(:url2) }
81
- it { should allow_value('http://example.org/lorem').for(:url2) }
79
+ it { is_expected.to allow_value('http://example.org').for(:url2) }
80
+ it { is_expected.to allow_value('http://example.org/lorem').for(:url2) }
82
81
  end
83
82
 
84
83
  describe 'url must have a specific scheme' do
@@ -93,12 +92,12 @@ describe UrlValidator do
93
92
 
94
93
  subject { klass.new }
95
94
 
96
- it { should allow_value('http://example.org').for(:url1) }
97
- it { should_not allow_value('https://example.org').for(:url1) }
95
+ it { is_expected.to allow_value('http://example.org').for(:url1) }
96
+ it { is_expected.not_to allow_value('https://example.org').for(:url1) }
98
97
 
99
- it { should allow_value('http://example.org').for(:url2) }
100
- it { should allow_value('https://example.org').for(:url2) }
101
- it { should allow_value('HTTPS://example.org').for(:url2) }
102
- it { should_not allow_value('ftp://example.org').for(:url2) }
98
+ it { is_expected.to allow_value('http://example.org').for(:url2) }
99
+ it { is_expected.to allow_value('https://example.org').for(:url2) }
100
+ it { is_expected.to allow_value('HTTPS://example.org').for(:url2) }
101
+ it { is_expected.not_to allow_value('ftp://example.org').for(:url2) }
103
102
  end
104
103
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: missing_validators
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrei Gridnev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-07 00:00:00.000000000 Z
11
+ date: 2015-05-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '3'
61
+ version: '3.2'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '3'
68
+ version: '3.2'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rubocop
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -100,20 +100,6 @@ dependencies:
100
100
  - - ">="
101
101
  - !ruby/object:Gem::Version
102
102
  version: 2.6.1
103
- - !ruby/object:Gem::Dependency
104
- name: shoulda
105
- requirement: !ruby/object:Gem::Requirement
106
- requirements:
107
- - - "~>"
108
- - !ruby/object:Gem::Version
109
- version: '3.5'
110
- type: :development
111
- prerelease: false
112
- version_requirements: !ruby/object:Gem::Requirement
113
- requirements:
114
- - - "~>"
115
- - !ruby/object:Gem::Version
116
- version: '3.5'
117
103
  - !ruby/object:Gem::Dependency
118
104
  name: shoulda-matchers
119
105
  requirement: !ruby/object:Gem::Requirement
@@ -141,9 +127,6 @@ dependencies:
141
127
  - - "~>"
142
128
  - !ruby/object:Gem::Version
143
129
  version: '0.4'
144
- - - ">="
145
- - !ruby/object:Gem::Version
146
- version: 0.4.7
147
130
  type: :development
148
131
  prerelease: false
149
132
  version_requirements: !ruby/object:Gem::Requirement
@@ -151,9 +134,6 @@ dependencies:
151
134
  - - "~>"
152
135
  - !ruby/object:Gem::Version
153
136
  version: '0.4'
154
- - - ">="
155
- - !ruby/object:Gem::Version
156
- version: 0.4.7
157
137
  description: |-
158
138
  Validates email addresses, URLs, IMEI, MAC addresses,
159
139
  latitude, longitude, hex colors and (in-)equality of attributes.
@@ -170,7 +150,7 @@ files:
170
150
  - LICENSE
171
151
  - README.md
172
152
  - Rakefile
173
- - config/locales/en.yml
153
+ - lib/locales/en.yml
174
154
  - lib/missing_validators.rb
175
155
  - lib/missing_validators/matchers/ensure_valid_email_format_of.rb
176
156
  - lib/missing_validators/matchers/ensure_valid_imei_format_of.rb