Sha256: c74178afcfe61dd456956586ff6d3c545103984852407922904df2bb8c684d91

Contents?: true

Size: 353 Bytes

Versions: 2

Compression:

Stored size: 353 Bytes

Contents

# frozen_string_literal: true

RSpec.describe FiniteMachine, '#events' do
  it "retrieves all event names" do
    fsm = FiniteMachine.new do
      initial :green

      event :start, :red => :green
      event :stop,  :green => :red
    end

    expect(fsm.current).to eql(:green)
    expect(fsm.events).to match_array([:init, :start, :stop])
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
finite_machine-0.12.1 spec/unit/event_names_spec.rb
finite_machine-0.12.0 spec/unit/event_names_spec.rb