Sha256: c3e1277eb738cc7465c932c695b6abcd227591dc6562a8ff194c51b426e48184

Contents?: true

Size: 529 Bytes

Versions: 4

Compression:

Stored size: 529 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe FiniteMachine::HookEvent, 'new' do
  let(:name)       { :green }
  let(:transition) { double(:transition) }
  let(:data)       { [:foo, :bar] }
  let(:object)     { described_class }

  subject(:hook) { object.new(name, transition, *data) }

  it "exposes readers" do
    expect(hook.name).to eql(name)
    expect(hook.data).to eql(data)
    expect(hook.type).to eql(object)
  end

  it "freezes object" do
    expect { hook.name = :red }.to raise_error(RuntimeError)
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
finite_machine-0.10.0 spec/unit/hook_event/initialize_spec.rb
finite_machine-0.9.2 spec/unit/hook_event/initialize_spec.rb
finite_machine-0.9.1 spec/unit/hook_event/initialize_spec.rb
finite_machine-0.9.0 spec/unit/hook_event/initialize_spec.rb