Sha256: 373790fc3e3cf238c47341226268711eb46d83f55b5192dfa1869dc870368c8f

Contents?: true

Size: 407 Bytes

Versions: 2

Compression:

Stored size: 407 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

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

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

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

  it "clears chain events" do
    event = double(:event)
    chain.add(:validated, event)
    expect(chain.empty?).to be(false)

    chain.clear
    expect(chain.empty?).to be(true)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

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