hermod 1.2.4 → 1.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/hermod/validators/non_negative.rb +1 -1
- data/lib/hermod/validators/non_zero.rb +1 -1
- data/lib/hermod/validators/range.rb +1 -1
- data/lib/hermod/validators/whole_units.rb +1 -1
- data/lib/hermod/version.rb +1 -1
- data/spec/hermod/validators/non_negative_spec.rb +4 -0
- data/spec/hermod/validators/non_zero_spec.rb +4 -0
- data/spec/hermod/validators/range_spec.rb +4 -0
- data/spec/hermod/validators/whole_units_spec.rb +4 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f21de3838137e5e173db7659b44dce6d0aad5a1
|
4
|
+
data.tar.gz: 1ebc8f0abee7ece91ed6d33f0d5ada0625b340ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f3b46d2f8bd2138ea5665937c363ab89ccb8770302ada2acca9f9b003469b834ef2ce6e9caf6dd7f243bc8bbfb95e8ad3bc83218246d3f4996046675e36df793
|
7
|
+
data.tar.gz: 82282f32439e82b57e2a0e0255e082b4b724ff47961511f11b58cc6e453e4fae6febc80189a73fa7d4c14f7b9b0bd9a8b59981b6a81491f70c7e2125276130bf
|
data/lib/hermod/version.rb
CHANGED
@@ -15,6 +15,10 @@ module Hermod
|
|
15
15
|
subject.valid?(0, {}).must_equal true
|
16
16
|
end
|
17
17
|
|
18
|
+
it "allows blank values" do
|
19
|
+
subject.valid?(nil, {}).must_equal true
|
20
|
+
end
|
21
|
+
|
18
22
|
it "raises an error for negative values" do
|
19
23
|
ex = proc { subject.valid?(-1, {}) }.must_raise InvalidInputError
|
20
24
|
ex.message.must_equal "cannot be negative"
|
@@ -15,6 +15,10 @@ module Hermod
|
|
15
15
|
subject.valid?(-1, {}).must_equal true
|
16
16
|
end
|
17
17
|
|
18
|
+
it "allows blank values" do
|
19
|
+
subject.valid?(nil, {}).must_equal true
|
20
|
+
end
|
21
|
+
|
18
22
|
it "raises an error for zero values" do
|
19
23
|
ex = proc { subject.valid?(0, {}) }.must_raise InvalidInputError
|
20
24
|
ex.message.must_equal "cannot be zero"
|
@@ -12,6 +12,10 @@ module Hermod
|
|
12
12
|
subject.valid?(7, {}).must_equal true
|
13
13
|
end
|
14
14
|
|
15
|
+
it "allows blank values" do
|
16
|
+
subject.valid?(nil, {}).must_equal true
|
17
|
+
end
|
18
|
+
|
15
19
|
it "raises an error for values outwith the range" do
|
16
20
|
ex = proc { subject.valid?(0, {}) }.must_raise InvalidInputError
|
17
21
|
ex.message.must_equal "must be between 1 and 7"
|
@@ -11,6 +11,10 @@ module Hermod
|
|
11
11
|
subject.valid?(1.0, {}).must_equal true
|
12
12
|
end
|
13
13
|
|
14
|
+
it "allows blank values" do
|
15
|
+
subject.valid?(nil, {}).must_equal true
|
16
|
+
end
|
17
|
+
|
14
18
|
it "raises an error for values with a fractional componant" do
|
15
19
|
ex = proc { subject.valid?(3.1415, {}) }.must_raise InvalidInputError
|
16
20
|
ex.message.must_equal "must be in whole units"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hermod
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Harry Mills
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: libxml-ruby
|