Sha256: bb83d14640ae4da1976f89c1bc8618f4a33132c624510ee962db5f2bcdcdab07

Contents?: true

Size: 557 Bytes

Versions: 2

Compression:

Stored size: 557 Bytes

Contents

# frozen_string_literal: true

RSpec.describe FiniteMachine::Transition, '#to_state' do
  let(:machine) { double(:machine) }

  it "finds to state" do
    states = {:green => :red}
    transition = described_class.new(machine, :event_name, states: states)

    expect(transition.to_state(:green)).to eq(:red)
  end

  it "finds to state for transition from any state" do
    states = {FiniteMachine::ANY_STATE => :red}
    transition = described_class.new(machine, :event_name, states: states)

    expect(transition.to_state(:green)).to eq(:red)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
finite_machine-0.12.1 spec/unit/transition/to_state_spec.rb
finite_machine-0.12.0 spec/unit/transition/to_state_spec.rb