field_mapper 0.1.1 → 0.2.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 +4 -4
- data/lib/field_mapper/errors.rb +13 -11
- data/lib/field_mapper/version.rb +1 -1
- data/test/custom/field_test.rb +1 -1
- data/test/custom/value_test.rb +2 -2
- data/test/standard/field_test.rb +1 -1
- data/test/types/list_test.rb +2 -2
- data/test/types/plat_test.rb +4 -4
- 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: bfe9de882a181be20182dea8a1808194d5cee08e
|
4
|
+
data.tar.gz: b269ff64187a983f56600042a8bd88e06109cfe2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3929ca29c513a13421ca4e7718388b84e5f5010e9b6a4ea8acbebe06bc96b39fbcb8be7613372ca9aefb35bd47ba067d03f19061978b6dedc04f54b6f19ad13b
|
7
|
+
data.tar.gz: 79e599d3b463d31d19c33f9e968e9f35fa9f28fea8239903798e7381895547a988effad49d48f4bc10d14ff925e2013e6a088200d9d93619f90bcaa3645f6003
|
data/lib/field_mapper/errors.rb
CHANGED
@@ -1,11 +1,13 @@
|
|
1
|
-
|
2
|
-
class
|
3
|
-
class
|
4
|
-
class
|
5
|
-
class
|
6
|
-
class
|
7
|
-
class
|
8
|
-
class
|
9
|
-
class
|
10
|
-
class
|
11
|
-
class
|
1
|
+
module FieldMapper
|
2
|
+
class StandardNotSet < StandardError; end
|
3
|
+
class StandardFieldNotFound < StandardError; end
|
4
|
+
class StandardValueNotFound < StandardError; end
|
5
|
+
class StandardMismatch < StandardError; end
|
6
|
+
class TypeNotSpecified < StandardError; end
|
7
|
+
class TypeNotSupported < StandardError; end
|
8
|
+
class FieldNotDefined < StandardError; end
|
9
|
+
class InvalidPlatType < StandardError; end
|
10
|
+
class InvalidListType < StandardError; end
|
11
|
+
class InvalidListValue < StandardError; end
|
12
|
+
class InvalidMarshal < StandardError; end
|
13
|
+
end
|
data/lib/field_mapper/version.rb
CHANGED
data/test/custom/field_test.rb
CHANGED
data/test/custom/value_test.rb
CHANGED
@@ -12,7 +12,7 @@ module Custom
|
|
12
12
|
begin
|
13
13
|
custom_field = FieldMapper::Custom::Field.new(:bar, type: Integer)
|
14
14
|
FieldMapper::Custom::Value.new(1, field: custom_field, standard_value: 1)
|
15
|
-
rescue StandardFieldNotFound => e
|
15
|
+
rescue FieldMapper::StandardFieldNotFound => e
|
16
16
|
error = e
|
17
17
|
end
|
18
18
|
assert error.present?
|
@@ -21,7 +21,7 @@ module Custom
|
|
21
21
|
test "constructor ensures standard_value exists" do
|
22
22
|
begin
|
23
23
|
FieldMapper::Custom::Value.new("a", field: @custom_field, standard_value: "a")
|
24
|
-
rescue StandardValueNotFound => e
|
24
|
+
rescue FieldMapper::StandardValueNotFound => e
|
25
25
|
error = e
|
26
26
|
end
|
27
27
|
assert error.present?
|
data/test/standard/field_test.rb
CHANGED
data/test/types/list_test.rb
CHANGED
@@ -6,7 +6,7 @@ class ListTest < MicroTest::Test
|
|
6
6
|
test "initialize fails with instance type" do
|
7
7
|
begin
|
8
8
|
FieldMapper::Types::List.new("")
|
9
|
-
rescue InvalidListType => error
|
9
|
+
rescue FieldMapper::InvalidListType => error
|
10
10
|
end
|
11
11
|
assert !error.nil?
|
12
12
|
end
|
@@ -14,7 +14,7 @@ class ListTest < MicroTest::Test
|
|
14
14
|
test "initialize fails with invalid type" do
|
15
15
|
begin
|
16
16
|
FieldMapper::Types::List.new(Object)
|
17
|
-
rescue InvalidListType => error
|
17
|
+
rescue FieldMapper::InvalidListType => error
|
18
18
|
end
|
19
19
|
assert !error.nil?
|
20
20
|
end
|
data/test/types/plat_test.rb
CHANGED
@@ -6,7 +6,7 @@ class PlatTest < MicroTest::Test
|
|
6
6
|
test "initialize fails with instance type" do
|
7
7
|
begin
|
8
8
|
FieldMapper::Types::Plat.new("")
|
9
|
-
rescue InvalidPlatType => error
|
9
|
+
rescue FieldMapper::InvalidPlatType => error
|
10
10
|
end
|
11
11
|
assert !error.nil?
|
12
12
|
end
|
@@ -14,7 +14,7 @@ class PlatTest < MicroTest::Test
|
|
14
14
|
test "initialize fails with non plat type" do
|
15
15
|
begin
|
16
16
|
FieldMapper::Types::Plat.new(String)
|
17
|
-
rescue InvalidPlatType => error
|
17
|
+
rescue FieldMapper::InvalidPlatType => error
|
18
18
|
end
|
19
19
|
assert !error.nil?
|
20
20
|
end
|
@@ -22,7 +22,7 @@ class PlatTest < MicroTest::Test
|
|
22
22
|
test "initialize succeeds with plat type" do
|
23
23
|
begin
|
24
24
|
FieldMapper::Types::Plat.new(Standard::PlatExample)
|
25
|
-
rescue InvalidPlatType => error
|
25
|
+
rescue FieldMapper::InvalidPlatType => error
|
26
26
|
end
|
27
27
|
assert error.nil?
|
28
28
|
end
|
@@ -30,7 +30,7 @@ class PlatTest < MicroTest::Test
|
|
30
30
|
test "[] construction" do
|
31
31
|
begin
|
32
32
|
FieldMapper::Types::Plat[Standard::PlatExample]
|
33
|
-
rescue InvalidPlatType => error
|
33
|
+
rescue FieldMapper::InvalidPlatType => error
|
34
34
|
end
|
35
35
|
assert error.nil?
|
36
36
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: field_mapper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Hopkins
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|