Sha256: 0065db0bfd78e9bcebe9973aef0da82b01d8b97c1037dc66807debb75f70b436

Contents?: true

Size: 898 Bytes

Versions: 7

Compression:

Stored size: 898 Bytes

Contents

# Basic class method specs

require 'spec_helper'
require 'maintain'

describe Maintain do
  before :each do
    class ::MaintainSubclassTest
      attr_accessor :existant_attribute
      extend Maintain
    end

    class ::MaintainSubclassTestSubclass < ::MaintainSubclassTest; end
  end

  it "should inherit maintainers from parent classes" do
    MaintainSubclassTest.maintain :status do
      state :new
      state :old
    end
    MaintainSubclassTestSubclass.maintainers[:status].should_not be_nil
  end

  it "should not propagate maintainers up the class system" do
    MaintainSubclassTest.maintain :status do
      state :new
      state :old
    end
    MaintainSubclassTestSubclass.maintain :foo do
      state :bar
      state :baz
    end
    MaintainSubclassTest.maintainers[:foo].should be_nil
    MaintainSubclassTestSubclass.maintainers[:status].should_not be_nil
  end

  
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
maintain-0.3.0 spec/subclass_spec.rb
maintain-0.2.23 spec/subclass_spec.rb
maintain-0.2.22 spec/subclass_spec.rb
maintain-0.2.21 spec/subclass_spec.rb
maintain-0.2.20 spec/subclass_spec.rb
maintain-0.2.19 spec/subclass_spec.rb
maintain-0.2.18 spec/subclass_spec.rb