Sha256: 53fbc81ef091cbb29e1e3c47134f47b5ccdf2b22929888e4ae93812b577a38dd

Contents?: true

Size: 535 Bytes

Versions: 2

Compression:

Stored size: 535 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

RSpec.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

2 entries across 2 versions & 1 rubygems

Version Path
finite_machine-0.10.2 spec/unit/hook_event/initialize_spec.rb
finite_machine-0.10.1 spec/unit/hook_event/initialize_spec.rb