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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YTE2YTRmYzdiNjgzM2JkYmE0MmYwOTljYmEzMmQwMmQwOWZmNzU1OQ==
4
+ MDZjNTU4YTQ1Yzc2YTUyMDIwNjQ4NWEyNmQxNWFkOWU2MzdhZThlNw==
5
5
  data.tar.gz: !binary |-
6
- MTgwYmE0NWU5YTZmZmQ0YWE2NDFkOTFhZmQwZGFlNmMyNDZjNzc4NA==
6
+ OWZiZDgzMjZiYThjN2EzODBmOWNkOGE1NGU1M2MyNzJhY2RhZmE1MA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MTdjYjQyYzM5NjlkNTMzMjNhNjNiZWNmMWUxMDA2MWY3MDVjZDVkYWI0NjA4
10
- ZTFjNTQ0ZDU2MjI2YzJlNjFmNWUwN2Q1OGNmMzY0ZGNlNWI4YjM3NTk3NmM0
11
- ZDNlODA2N2IwYWYyZTBmMjcwMWQ0YmU4NDQxOTM1YTY1OTdmNDU=
9
+ OTNjZGRmNTY0NzM4MTI0NjgxODc5YjkzNmU0MGM1ZDg1MGZjZDg2ODhkZTM1
10
+ MDRlZjdhMjFhMWIxNGRkZDcyZWNiMWNlYWY1YWUwYTU0ZDg1YWY1ZmI0MTAz
11
+ ZDQxM2VjMDQxYzkzMmIyYTViNTBlODQ5MmFmOGMxYmQxODc0MWM=
12
12
  data.tar.gz: !binary |-
13
- MGNlMmQ0ZDY0ZjIzMGI2OGU5NzkwZTkwMDIzY2MzY2RjZjJmNTVlYjlkOTkz
14
- NjdiOWU5MWQwNjM3Mjg0MzMxMDZlZTY0MDdmNGVjNjZiNzgyYzFmOGE2Mzhm
15
- YjE2ZmE1YjNjNzkyYTJkY2RkYmM1ZWIxZmU5OGFmNzgzM2FmODE=
13
+ OTJkYjRkNzZjM2IwNTQxNGIwNzg2NGFlOWNhYzQ4ZGZmZjAxYzBhZDMwM2Q1
14
+ N2YyNjBlNTY5ZmFmMThhZTkyNTY3ZjJjMTIxZGM3MDJjMjcwYmQ3OTY3YWNj
15
+ MDU2ODNlZGNjNDdiZjMwZWZhOTgwNDkzNmIzZTczMDYxYmYyYWY=
@@ -18,7 +18,7 @@ module Acfs::Model
18
18
  #
19
19
  class Boolean < Base
20
20
 
21
- TRUE_VALUES = %w(true on yes)
21
+ TRUE_VALUES = %w(true on yes 1)
22
22
 
23
23
  # @api public
24
24
  #
@@ -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.b206
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-27 00:00:00.000000000 Z
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