Sha256: 6219639290f0c3fbbba0d29af42d0b864480824f53210b6f3d1274140e85d2d6
Contents?: true
Size: 611 Bytes
Versions: 6
Compression:
Stored size: 611 Bytes
Contents
require "helper" class TestEventBeingFired < Test::Unit::TestCase test "should raise an Transitions::InvalidTransition error if the transitions are empty" do event = Transitions::Event.new(nil, :event) assert_raise Transitions::InvalidTransition do event.fire(nil) end end test "should return the state of the first matching transition it finds" do event = Transitions::Event.new(nil, :event) do transitions :to => :closed, :from => [:open, :received] end obj = stub obj.stubs(:current_state).returns(:open) assert_equal :closed, event.fire(obj) end end
Version data entries
6 entries across 6 versions & 1 rubygems