2011-06-09 01:05:22 +02:00
|
|
|
require 'spec_helper'
|
2010-02-27 01:39:09 +01:00
|
|
|
|
2011-06-08 18:22:35 +02:00
|
|
|
class PlainParent
|
|
|
|
class_inheritable_accessor :foo
|
|
|
|
self.foo = :bar
|
|
|
|
end
|
2010-02-27 01:39:09 +01:00
|
|
|
|
2011-06-08 18:22:35 +02:00
|
|
|
class PlainChild < PlainParent
|
|
|
|
end
|
2010-02-27 01:39:09 +01:00
|
|
|
|
2011-06-08 18:22:35 +02:00
|
|
|
class ExtendedParent < CouchRest::Model::Base
|
|
|
|
class_inheritable_accessor :foo
|
|
|
|
self.foo = :bar
|
|
|
|
end
|
2010-02-27 01:39:09 +01:00
|
|
|
|
2011-06-08 18:22:35 +02:00
|
|
|
class ExtendedChild < ExtendedParent
|
|
|
|
end
|
2010-02-27 01:39:09 +01:00
|
|
|
|
2011-06-08 18:22:35 +02:00
|
|
|
describe "Using chained inheritance without CouchRest::Model::Base" do
|
|
|
|
it "should preserve inheritable attributes" do
|
|
|
|
PlainParent.foo.should == :bar
|
|
|
|
PlainChild.foo.should == :bar
|
2010-02-27 01:39:09 +01:00
|
|
|
end
|
2011-06-08 18:22:35 +02:00
|
|
|
end
|
2010-02-27 01:39:09 +01:00
|
|
|
|
2011-06-08 18:22:35 +02:00
|
|
|
describe "Using chained inheritance with CouchRest::Model::Base" do
|
|
|
|
it "should preserve inheritable attributes" do
|
|
|
|
ExtendedParent.foo.should == :bar
|
|
|
|
ExtendedChild.foo.should == :bar
|
2010-02-27 01:39:09 +01:00
|
|
|
end
|
|
|
|
end
|
2011-06-08 18:22:35 +02:00
|
|
|
|
|
|
|
|