haz_enum 0.4.2 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.2
1
+ 0.4.3
data/haz_enum.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{haz_enum}
8
- s.version = "0.4.2"
8
+ s.version = "0.4.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["thyphoon"]
data/lib/haz_enum/set.rb CHANGED
@@ -71,7 +71,7 @@ module HazEnum
71
71
  end
72
72
 
73
73
  define_method("initialize_#{set_name}_from_yml") do
74
- deserialized_value = (YAML::load(self[set_column]) || [])
74
+ deserialized_value = (YAML::load(self[set_column] || "--- \n") || [])
75
75
  send("#{set_name}=", deserialized_value)
76
76
  end
77
77
 
data/spec/set_spec.rb CHANGED
@@ -17,6 +17,10 @@ describe "HazEnum" do
17
17
  ClassWithSet.new(:roles => [Roles::User, Roles::Admin]).roles[1].should be(Roles::Admin)
18
18
  end
19
19
 
20
+ it "should have empty array as default-value" do
21
+ ClassWithSet.new.roles.should == []
22
+ end
23
+
20
24
  it "should be able to save values as yml" do
21
25
  YmlSet.new(:roles => [Roles::User, Roles::Admin]).roles[1].should be(Roles::Admin)
22
26
  yml_set = YmlSet.create(:roles => [Roles::User, Roles::Admin])
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 4
8
- - 2
9
- version: 0.4.2
8
+ - 3
9
+ version: 0.4.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - thyphoon