Sha256: 294989ee62b668b27d9b1d505eb2a3cb0e2c46d933958638d9b3838cc13ae48f
Contents?: true
Size: 1.08 KB
Versions: 15
Compression:
Stored size: 1.08 KB
Contents
require 'spec_helper' describe Celluloid::Properties do let(:default_value) { 42 } let(:changed_value) { 43 } let(:example_class) do Class.new do extend Celluloid::Properties property :baz, :default => 42 end end let(:example_subclass) do Class.new(example_class) end let(:example_subclass_subclass) do Class.new(example_subclass) end it "adds properties to classes" do example_class.baz.should eq default_value example_class.baz changed_value example_class.baz.should eq changed_value end it "allows properties to be inherited" do example_subclass.baz.should eq default_value example_subclass.baz changed_value example_subclass.baz.should eq changed_value example_class.baz.should eq default_value end it "allows properties to be deeply inherited" do example_subclass_subclass.baz.should eq default_value example_subclass_subclass.baz changed_value example_subclass_subclass.baz.should eq changed_value example_subclass.baz.should eq default_value example_class.baz.should eq default_value end end
Version data entries
15 entries across 13 versions & 5 rubygems