Sha256: 3181a4d33e413e1a39dc843159227cb909e4a36f05d371a346dd576d0cba1e04
Contents?: true
Size: 704 Bytes
Versions: 1
Compression:
Stored size: 704 Bytes
Contents
require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper') module Recliner describe Document do context "with properties with default values" do define_recliner_document :TestDocument do property :name, String, :default => 'Hello' property :age, Integer, :default => 21 property :no_default, String end subject { TestDocument.new } it "should initialize the attributes to their default values" do subject.name.should == 'Hello' subject.age.should == 21 end it "should not initialize attributes without default values" do subject.no_default.should be_nil end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
recliner-0.0.1 | spec/recliner/document/attribute_methods/defaults_spec.rb |