Sha256: 3d7312c65c934e02f43e9a7a7f21ddf29b3645028d83e52165bee7994ca62719

Contents?: true

Size: 684 Bytes

Versions: 4

Compression:

Stored size: 684 Bytes

Contents

# Tests on integer-specific functionality

require 'lib/maintain'

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

  describe "integer" do
    before :each do
      MaintainTest.maintain :kind, :integer => true do
        state :man, 1
        state :woman, 2
        state :none, 3
      end
      @maintainer = MaintainTest.new
    end

    it "should handle numbery strings" do
      @maintainer.kind = "3"
      @maintainer.none?.should be_true
    end

    it "should return valid names, too" do
      @maintainer.kind = :woman
      @maintainer.kind.should == 2
      @maintainer.kind.name.should == "woman"
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
maintain-0.2.5 spec/integer_spec.rb
maintain-0.2.4 spec/integer_spec.rb
maintain-0.2.2 spec/integer_spec.rb
maintain-0.2.1 spec/integer_spec.rb