ethos 0.2.0.beta2 → 0.2.0.beta3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 48025a24e4808b486dda4d900c8dba809eaa3ad2
4
- data.tar.gz: 64e974f41db04e23ac4c78de7daf80396c7112b4
3
+ metadata.gz: 8ee0d4eb3b806134f48dc44e904f82a3307fa385
4
+ data.tar.gz: 94331cd4a93fa367f59038c11e4e86812c65f19c
5
5
  SHA512:
6
- metadata.gz: 888d41438ddd11d02ea08abdd268a76c0e2c7e90eca336eb2a22974fb52f2a5146d5966977ee947c7787eb17696780a78ee635efcc4ebfe5f2cc5d3ad83029ef
7
- data.tar.gz: 6a48897c89b488b756c8733db838b339169557cedd0c412c70416f479f323419c4846ee9f2421aa21f0dd56feb79d0c393192850eff8cb80af40a8a18d707077
6
+ metadata.gz: 286ee730bd33ad3efd7ddea9c572252a4e998a9b5558a77ee74e9d78c1fc228e7a6821208ed86d7396b671c656b105fb8b3457bdb7b9c1375a667f2a509cee66
7
+ data.tar.gz: f26d4be1f6442a052c940edc1c0b0ea22465aab0ef3825f4e3d306c6490a32b3748b335abc121fa4669f7b5cd43d6ed079ad84d292723967a7d95d19e2a38283
data/README.md CHANGED
@@ -1,4 +1,5 @@
1
1
  [![Code Climate Score](http://img.shields.io/codeclimate/github/Erol/ethos.svg?style=flat)](https://codeclimate.com/github/Erol/ethos)
2
+ [![Test Coverage](https://codeclimate.com/github/Erol/ethos/badges/coverage.svg)](https://codeclimate.com/github/Erol/ethos)
2
3
 
3
4
  # Ethos
4
5
 
@@ -18,6 +18,8 @@ module Ethos
18
18
  @_schema = schema
19
19
 
20
20
  values.each do |key, value|
21
+ key = key.to_sym
22
+
21
23
  initial[key] = value
22
24
  current[key] = value
23
25
  end
@@ -1,3 +1,3 @@
1
1
  module Ethos
2
- VERSION = '0.2.0.beta2'
2
+ VERSION = '0.2.0.beta3'
3
3
  end
@@ -39,4 +39,10 @@ scope do
39
39
 
40
40
  asserts(attributes[:value]) == 1
41
41
  end
42
+
43
+ spec do
44
+ attributes = Ethos::Attributes.new schema, values: {'value' => '1'}
45
+
46
+ asserts(attributes[:value]) == 1
47
+ end
42
48
  end
@@ -52,15 +52,17 @@ scope '.cast' do
52
52
  end
53
53
 
54
54
  spec 'casts a value to a Hash' do
55
- expected = Hash[:a, 1]
55
+ expected = {a: 1}
56
56
  result = Ethos::Type.cast [:a, 1], Hash
57
57
 
58
58
  asserts(result) == expected
59
59
  end
60
60
 
61
61
  spec 'casts a value to a Array' do
62
- expected = Array[1, 2]
63
- result = Ethos::Type.cast [1, 2], Array
62
+ values = {a: 1, b: 2}
63
+
64
+ expected = [[:a, 1], [:b, 2]]
65
+ result = Ethos::Type.cast values, Array
64
66
 
65
67
  asserts(result) == expected
66
68
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ethos
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0.beta2
4
+ version: 0.2.0.beta3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erol Fornoles
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-21 00:00:00.000000000 Z
11
+ date: 2015-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler