Sha256: 9553dfed8ec8d04cc001b49e9e98903cd4854d6aff4a9db22d16cf42c640b80a

Contents?: true

Size: 543 Bytes

Versions: 2

Compression:

Stored size: 543 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

RSpec.describe FiniteMachine::EventsChain, '#select_transition' do
  let(:object)  { described_class }

  let(:machine) { double(:machine) }

  let(:transition) { double(:transition) }

  subject(:chain) { object.new(machine) }

  it "selects transition" do
    event = double(:event)
    args = double(:args)
    chain.add(:validated, event)
    expect(chain[:validated]).to eq(event)

    expect(event).to receive(:find_transition).with(args)
    chain.select_transition(:validated, args)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
finite_machine-0.10.2 spec/unit/events_chain/select_transition_spec.rb
finite_machine-0.10.1 spec/unit/events_chain/select_transition_spec.rb