Sha256: ce2e709ca6569728c142d335643b36be738da8142e24cce80f2b1ba805f2f662
Contents?: true
Size: 787 Bytes
Versions: 18
Compression:
Stored size: 787 Bytes
Contents
# Specs for aggregation of state require 'lib/maintain' describe Maintain, "aggregates" do before :each do class ::MaintainTest extend Maintain end end it "should allow me to define an aggregate" do lambda { MaintainTest.maintains :state do state :old state :new state :borrowed state :blue aggregate :b_words, [:borrowed, :blue] end }.should_not raise_error end it "should create boolean methods" do MaintainTest.new.should respond_to(:b_words?) end it "should return true if one of the states is met in the boolean" do maintain = MaintainTest.new maintain.state = :new maintain.b_words?.should be_false maintain.state = :blue maintain.b_words?.should be_true end end
Version data entries
18 entries across 18 versions & 1 rubygems