Sha256: 6c43564fb3c32960e9ae0fbc96a90e69d18da5d76527416cc67b37767b03385b

Contents?: true

Size: 676 Bytes

Versions: 4

Compression:

Stored size: 676 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

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.name = :red }.to raise_error(RuntimeError)
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
finite_machine-0.11.3 spec/unit/hook_event/initialize_spec.rb
finite_machine-0.11.2 spec/unit/hook_event/initialize_spec.rb
finite_machine-0.11.1 spec/unit/hook_event/initialize_spec.rb
finite_machine-0.11.0 spec/unit/hook_event/initialize_spec.rb