Sha256: 805aa025e02f8c7d677281b4d4e56fd32281c11575ef0e74c3226a0822269627

Contents?: true

Size: 504 Bytes

Versions: 2

Compression:

Stored size: 504 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

RSpec.describe FiniteMachine, '#inspect' do
  it "print useful information about state machine" do
    fsm = FiniteMachine.define do
      initial :green

      events {
        event :slow,  :green  => :yellow
        event :stop,  :yellow => :red
      }
    end
    expect(fsm.inspect).to match(/^<#FiniteMachine::StateMachine:0x#{fsm.object_id.to_s(16)} @states=\[:none, :green, :yellow, :red\], @events=\[:init, :slow, :stop\], @transitions=.*$/)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
finite_machine-0.10.2 spec/unit/inspect_spec.rb
finite_machine-0.10.1 spec/unit/inspect_spec.rb