Sha256: b9d05081fd5bbf3c191fcde1bcfe5ddd13658a24ff9a19be166d9f2db7025048

Contents?: true

Size: 683 Bytes

Versions: 4

Compression:

Stored size: 683 Bytes

Contents

require 'spec_helper'

class PlainParent
  class_inheritable_accessor :foo
  self.foo = :bar
end

class PlainChild < PlainParent
end

class ExtendedParent < CouchRest::Model::Base
  class_inheritable_accessor :foo
  self.foo = :bar
end

class ExtendedChild < ExtendedParent
end

describe "Using chained inheritance without CouchRest::Model::Base" do
  it "should preserve inheritable attributes" do
    PlainParent.foo.should == :bar
    PlainChild.foo.should == :bar
  end
end

describe "Using chained inheritance with CouchRest::Model::Base" do
  it "should preserve inheritable attributes" do
    ExtendedParent.foo.should == :bar
    ExtendedChild.foo.should == :bar
  end
end


Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
openlogic-couchrest_model-1.0.0 spec/unit/inherited_spec.rb
couchrest_model-1.1.2 spec/unit/inherited_spec.rb
couchrest_model-1.1.1 spec/unit/inherited_spec.rb
couchrest_model-1.1.0 spec/unit/inherited_spec.rb