Sha256: 6942eeda02b7c0ea2524db586f6d800e6ce51fc7ee142d7093ea1a39ce784f9e

Contents?: true

Size: 622 Bytes

Versions: 2

Compression:

Stored size: 622 Bytes

Contents

# frozen_string_literal: true

RSpec.describe FiniteMachine::EventsMap, '#add' do
  it "adds transitions" do
    transition = double(:transition)
    events_map = described_class.new

    events_map.add(:validated, transition)
    expect(events_map[:validated]).to eq([transition])

    events_map.add(:validated, transition)
    expect(events_map[:validated]).to eq([transition, transition])
  end

  it "allows to map add operations" do
    events_map = described_class.new
    transition = double(:transition)

    events_map.add(:go, transition).add(:start, transition)

    expect(events_map.size).to eq(2)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
finite_machine-0.12.1 spec/unit/events_map/add_spec.rb
finite_machine-0.12.0 spec/unit/events_map/add_spec.rb