Sha256: c5454063fe187382707a461a3967c4eb1fc06b2f6419cf935fc2d7ea352afb39
Contents?: true
Size: 1.33 KB
Versions: 18
Compression:
Stored size: 1.33 KB
Contents
# Specs for assigning states require 'lib/maintain' describe Maintain do before :each do class ::MaintainTest attr_accessor :existant_attribute extend Maintain end end describe "setting" do describe "string states" do before :each do MaintainTest.maintain :state do state :new state :overdue state :closed end @maintainer = MaintainTest.new end it "should, you know, work" do @maintainer.state = :new @maintainer.state.should == :new @maintainer.state = 'new' @maintainer.state.should == :new @maintainer.state = 0 @maintainer.state.should == :new @maintainer.state.name.should == "new" @maintainer.state = 'nada' @maintainer.state.should be_nil end end describe "integer states" do before :each do MaintainTest.maintain :state do state :new, 1 state :overdue, 2 state :closed, 3 end @maintainer = MaintainTest.new end it "should, you know, work" do @maintainer.state = 1 @maintainer.state.should == :new @maintainer.state = 'new' @maintainer.state.should == :new @maintainer.state = :new @maintainer.state.should == :new end end end end
Version data entries
18 entries across 18 versions & 1 rubygems