spec/ripple/properties_spec.rb in ripple-0.8.0 vs spec/ripple/properties_spec.rb in ripple-0.8.1

- old
+ new

@@ -75,10 +75,15 @@ it "should cast to the proper type" do prop = Ripple::Property.new('foo', String, :default => :bar) prop.default.should == "bar" end + it "should allow false for a Boolean" do + prop = Ripple::Property.new('foo', Boolean, :default => false) + prop.default.should == false + end + it "should allow lambdas for deferred evaluation" do prop = Ripple::Property.new('foo', String, :default => lambda { "bar" }) prop.default.should == "bar" end end @@ -120,14 +125,14 @@ @prop.type_cast([]).should == "" else @prop.type_cast([]).should == "[]" end end - + it "should not cast nil" do @prop.type_cast(nil).should be_nil end - + end describe "when type is an Integer type" do before :each do @prop = Ripple::Property.new(:foo, Integer)