acfs 0.23.2.b206 → 0.23.2.b208
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/acfs/model/attributes/boolean.rb +1 -1
- data/spec/acfs/model/attributes/boolean_spec.rb +25 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MDZjNTU4YTQ1Yzc2YTUyMDIwNjQ4NWEyNmQxNWFkOWU2MzdhZThlNw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
OWZiZDgzMjZiYThjN2EzODBmOWNkOGE1NGU1M2MyNzJhY2RhZmE1MA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
OTNjZGRmNTY0NzM4MTI0NjgxODc5YjkzNmU0MGM1ZDg1MGZjZDg2ODhkZTM1
|
10
|
+
MDRlZjdhMjFhMWIxNGRkZDcyZWNiMWNlYWY1YWUwYTU0ZDg1YWY1ZmI0MTAz
|
11
|
+
ZDQxM2VjMDQxYzkzMmIyYTViNTBlODQ5MmFmOGMxYmQxODc0MWM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
OTJkYjRkNzZjM2IwNTQxNGIwNzg2NGFlOWNhYzQ4ZGZmZjAxYzBhZDMwM2Q1
|
14
|
+
N2YyNjBlNTY5ZmFmMThhZTkyNTY3ZjJjMTIxZGM3MDJjMjcwYmQ3OTY3YWNj
|
15
|
+
MDU2ODNlZGNjNDdiZjMwZWZhOTgwNDkzNmIzZTczMDYxYmYyYWY=
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Acfs::Model::Attributes::Boolean do
|
4
|
+
subject { Acfs::Model::Attributes::Boolean.new }
|
5
|
+
|
6
|
+
describe 'cast' do
|
7
|
+
it 'should preserve boolean values' do
|
8
|
+
expect(subject.cast(false)).to eq false
|
9
|
+
expect(subject.cast(true)).to eq true
|
10
|
+
end
|
11
|
+
|
12
|
+
it 'should cast TRUE_VALUES to true' do
|
13
|
+
expect(subject.cast('yes')).to eq true
|
14
|
+
expect(subject.cast('on')).to eq true
|
15
|
+
expect(subject.cast('true')).to eq true
|
16
|
+
expect(subject.cast('1')).to eq true
|
17
|
+
end
|
18
|
+
|
19
|
+
it 'should cast any other value to false' do
|
20
|
+
expect(subject.cast('')).to eq false
|
21
|
+
expect(subject.cast('wrong')).to eq false
|
22
|
+
expect(subject.cast('random')).to eq false
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: acfs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.23.2.
|
4
|
+
version: 0.23.2.b208
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Graichen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-11-
|
11
|
+
date: 2013-11-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -179,6 +179,7 @@ files:
|
|
179
179
|
- spec/acfs/configuration_spec.rb
|
180
180
|
- spec/acfs/middleware/json_decoder_spec.rb
|
181
181
|
- spec/acfs/middleware/msgpack_decoder_spec.rb
|
182
|
+
- spec/acfs/model/attributes/boolean_spec.rb
|
182
183
|
- spec/acfs/model/attributes/date_time_spec.rb
|
183
184
|
- spec/acfs/model/attributes/float_spec.rb
|
184
185
|
- spec/acfs/model/attributes/list_spec.rb
|
@@ -230,6 +231,7 @@ test_files:
|
|
230
231
|
- spec/acfs/configuration_spec.rb
|
231
232
|
- spec/acfs/middleware/json_decoder_spec.rb
|
232
233
|
- spec/acfs/middleware/msgpack_decoder_spec.rb
|
234
|
+
- spec/acfs/model/attributes/boolean_spec.rb
|
233
235
|
- spec/acfs/model/attributes/date_time_spec.rb
|
234
236
|
- spec/acfs/model/attributes/float_spec.rb
|
235
237
|
- spec/acfs/model/attributes/list_spec.rb
|