horcrux 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/horcrux.gemspec CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
12
12
  ## If your rubyforge_project name is different, then edit it and comment out
13
13
  ## the sub! line in the Rakefile
14
14
  s.name = 'horcrux'
15
- s.version = '0.0.3'
15
+ s.version = '0.0.4'
16
16
  s.date = '2012-01-03'
17
17
  s.rubyforge_project = 'horcrux'
18
18
 
@@ -102,7 +102,7 @@ module Horcrux
102
102
  end
103
103
 
104
104
  define_method "#{key_s}=" do |value|
105
- unless value.is_a?(klass)
105
+ unless value.nil? || value.is_a?(klass)
106
106
  raise TypeError, "#{key_s} should be a #{klass}: #{value.inspect}"
107
107
  end
108
108
  instance_variable_set(ivar_key, value)
data/lib/horcrux.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # See the README.md
2
2
  module Horcrux
3
- VERSION = "0.0.3"
3
+ VERSION = "0.0.4"
4
4
 
5
5
  # Implements the optional methods of a Horcrux adapter.
6
6
  module Methods
data/test/entity_test.rb CHANGED
@@ -64,6 +64,12 @@ module Horcrux
64
64
  ent.update_attrs :created_at => Time.now
65
65
  end
66
66
 
67
+ ent.roles = nil
68
+ assert_equal [], ent.roles
69
+
70
+ ent.codes = nil
71
+ assert_equal({}, ent.codes)
72
+
67
73
  assert_raises TypeError do
68
74
  ent.roles = 1
69
75
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: horcrux
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-01-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
16
- requirement: &70345641955860 !ruby/object:Gem::Requirement
16
+ requirement: &70162015702560 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70345641955860
24
+ version_requirements: *70162015702560
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: test-unit
27
- requirement: &70345641955280 !ruby/object:Gem::Requirement
27
+ requirement: &70162015699840 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70345641955280
35
+ version_requirements: *70162015699840
36
36
  description: Simple key/value adapter library.
37
37
  email: technoweenie@gmail.com
38
38
  executables: []