Sha256: 91294218c4ba418923e415596fbd8804da3b40960bfb7a59f4a7018b53567e2a

Contents?: true

Size: 704 Bytes

Versions: 8

Compression:

Stored size: 704 Bytes

Contents

require 'pathname'
require Pathname(__FILE__).dirname.expand_path.parent.parent + 'spec_helper'

module EventHelper
  def new_event(*args)
    DataMapper::Is::StateMachine::Data::Event.new(*args)
  end
end

describe DataMapper::Is::StateMachine::Data::Event do
  include EventHelper

  before(:each) do
    @machine = mock("machine")
    @event = new_event(:ping, @machine)
  end

  it "#initialize should work" do
    @event.name.should        == :ping
    @event.machine.should     == @machine
    @event.transitions.should == []
  end

  it "#add_transition should work" do
    @event.add_transition(:nothing, :pinged)
    @event.transitions.should == [{:from => :nothing, :to => :pinged }]
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
dm-is-state_machine-0.9.6 spec/unit/data/event_spec.rb
dm-is-state_machine-0.9.7 spec/unit/data/event_spec.rb
dm-is-state_machine-0.9.8 spec/unit/data/event_spec.rb
dm-is-state_machine-0.9.9 spec/unit/data/event_spec.rb
dm-is-state_machine-0.9.10 spec/unit/data/event_spec.rb
dm-is-state_machine-0.9.11 spec/unit/data/event_spec.rb
dm-is-state_machine-0.9.4 spec/unit/data/event_spec.rb
dm-is-state_machine-0.9.5 spec/unit/data/event_spec.rb