Sha256: 706be09e2bf37e7040c4f983cf362abd12e8f3a175b4ecfd15464f4bc0f83e4b

Contents?: true

Size: 681 Bytes

Versions: 2

Compression:

Stored size: 681 Bytes

Contents

require 'spec_helper'

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

class PlainChild < PlainParent
end

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

class ExtendedChild < ExtendedParent
end

describe "Using chained inheritance without CouchRest::Model::Base" do
  it "should preserve inheritable attributes" do
    expect(PlainParent.foo).to eq(:bar)
    expect(PlainChild.foo).to eq(:bar)
  end
end

describe "Using chained inheritance with CouchRest::Model::Base" do
  it "should preserve inheritable attributes" do
    expect(ExtendedParent.foo).to eq(:bar)
    expect(ExtendedChild.foo).to eq(:bar)
  end
end


Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
couchrest_model-2.2.0.beta2 spec/unit/inherited_spec.rb
couchrest_model-2.2.0.beta1 spec/unit/inherited_spec.rb