Sha256: f96a3adb4253edcd269bd08316cbf847d02e5dbe3cfae87b13cd081586594f4d

Contents?: true

Size: 641 Bytes

Versions: 2

Compression:

Stored size: 641 Bytes

Contents

# frozen_string_literal: true

RSpec.describe FiniteMachine::HookEvent, '#new' do
  it "reads event name" do
    hook_event = described_class.new(:green, :go, :green)
    expect(hook_event.name).to eql(:green)
  end

  it "reads event type" do
    hook_event = described_class.new(:green, :go, :green)
    expect(hook_event.type).to eql(FiniteMachine::HookEvent)
  end

  it "reads the from state" do
    hook_event = described_class.new(:green, :go, :red)
    expect(hook_event.from).to eql(:red)
  end

  it "freezes object" do
    hook_event = described_class.new(:green, :go, :green)
    expect(hook_event.frozen?).to eq(true)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
finite_machine-0.12.1 spec/unit/hook_event/initialize_spec.rb
finite_machine-0.12.0 spec/unit/hook_event/initialize_spec.rb