normalize 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/normalize.rb +5 -1
- data/normalize.gemspec +1 -1
- data/spec/lib/normalize_spec.rb +14 -0
- metadata +3 -3
data/lib/normalize.rb
CHANGED
data/normalize.gemspec
CHANGED
data/spec/lib/normalize_spec.rb
CHANGED
@@ -16,6 +16,20 @@ describe Normalize do
|
|
16
16
|
it 'normalizes the given value with the given normalizer' do
|
17
17
|
normalizer.normalize_value("string", -> input { input.upcase }).should == "STRING"
|
18
18
|
end
|
19
|
+
|
20
|
+
it 'does not normalize the value if it is empty' do
|
21
|
+
normalization = mock
|
22
|
+
normalization.should_not_receive(:call)
|
23
|
+
|
24
|
+
normalizer.normalize_value('', normalization)
|
25
|
+
end
|
26
|
+
|
27
|
+
it 'does not normalize the value if it is nil' do
|
28
|
+
normalization = mock
|
29
|
+
normalization.should_not_receive(:call)
|
30
|
+
|
31
|
+
normalizer.normalize_value(nil, normalization)
|
32
|
+
end
|
19
33
|
end
|
20
34
|
end
|
21
35
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: normalize
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2011-10-19 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|
16
|
-
requirement: &
|
16
|
+
requirement: &70204692924000 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
version: '3.0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70204692924000
|
25
25
|
description: The attribute normalizer.
|
26
26
|
email: ik@tom-eric.info
|
27
27
|
executables: []
|