activemodel-url_validator 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/activemodel-url_validator.rb +1 -0
- data/lib/url_validator/version.rb +1 -1
- data/spec/url_validator_spec.rb +15 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4bb9989541a1701bf58e3139b0cdaa378cd7159e
|
4
|
+
data.tar.gz: a10a1ca6edafe7030c78f507cfce35440f93e110
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab1d276a1d70a73bfe79e00a40aecdea10292c6eeb8adb0cef9bcb1dad4e8a8c53f169daf9be50215416c61794eff044ac922f3c5fd682461916fdf7a48bdbe7
|
7
|
+
data.tar.gz: fa0360c7b91e6549efdc610681e7bcd1997931ebb20f92ac9904ea4e400a560e1262ae52e8f679af8b4a1e29a5efb90a29744b325772a6b18284e034a4dbe696
|
data/spec/url_validator_spec.rb
CHANGED
@@ -14,6 +14,12 @@ shared_examples_for 'scheme less value is given', given: :scheme_less do
|
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
|
+
shared_examples_for 'empty string is given', given: :empty do
|
18
|
+
let(:value) do
|
19
|
+
''
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
17
23
|
shared_examples_for 'host less value is given', given: :host_less do
|
18
24
|
let(:value) do
|
19
25
|
'http:///host/less'
|
@@ -68,7 +74,11 @@ describe UrlValidator do
|
|
68
74
|
options
|
69
75
|
end
|
70
76
|
|
71
|
-
context 'when
|
77
|
+
context 'when an empty string is given', given: :empty do
|
78
|
+
it { should be_falsey }
|
79
|
+
end
|
80
|
+
|
81
|
+
context 'when an invalid value is given', given: :invalid do
|
72
82
|
it { should be_falsey }
|
73
83
|
end
|
74
84
|
|
@@ -133,6 +143,10 @@ describe UrlValidator do
|
|
133
143
|
it { should be_invalid }
|
134
144
|
end
|
135
145
|
|
146
|
+
context 'and an empty string is given', given: :empty do
|
147
|
+
it { should be_invalid }
|
148
|
+
end
|
149
|
+
|
136
150
|
context 'and a valid http value is given', given: :http do
|
137
151
|
it { should be_valid }
|
138
152
|
end
|