Sha256: 574c77013f539570a00d6b97dceccadfb7cf1f25b4365fafd940a8191418e551

Contents?: true

Size: 655 Bytes

Versions: 5

Compression:

Stored size: 655 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe FiniteMachine::EventsChain, '#insert' do
  let(:object)  { described_class }

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

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

  it "inspects empty chain" do
    expect(chain.inspect).to eq("<#FiniteMachine::EventsChain @chain={}>")
  end

  it "inspect chain" do
    event = double(:event)
    chain.add(:validated, event)
    expect(chain.inspect).to eq("<#FiniteMachine::EventsChain @chain=#{{validated: event}}>")
  end

  it "prints chain" do
    event = double(:event)
    chain.add(:validated, event)
    expect(chain.to_s).to eq("#{{validated: event}}")
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
finite_machine-0.10.0 spec/unit/events_chain/inspect_spec.rb
finite_machine-0.9.2 spec/unit/events_chain/inspect_spec.rb
finite_machine-0.9.1 spec/unit/events_chain/inspect_spec.rb
finite_machine-0.9.0 spec/unit/events_chain/inspect_spec.rb
finite_machine-0.8.1 spec/unit/events_chain/inspect_spec.rb