Sha256: 4c1e3b637ccb0f5cbf570c0975e6eaa9031e5333111a8e74b4c9a376ca1d5ca2

Contents?: true

Size: 808 Bytes

Versions: 2

Compression:

Stored size: 808 Bytes

Contents

# Basic class method specs

require 'lib/maintain'

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

    class ::MaintainTestSubclass < ::MaintainTest; end
  end

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

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

  
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
maintain-0.2.8 spec/subclass_spec.rb
maintain-0.2.6 spec/subclass_spec.rb