Sha256: 3d0b0caee80920693a99c58ab94f84b4d1b32cea9ca37f9554814a0ad8b81784
Contents?: true
Size: 801 Bytes
Versions: 2
Compression:
Stored size: 801 Bytes
Contents
# encoding: utf-8 require 'spec_helper' RSpec.describe FiniteMachine::Event, 'new' do let(:machine) { double(:machine) } let(:name) { :green } let(:options) { {} } let(:object) { described_class } subject(:event) { object.new(machine, options) } context "by default" do it "sets name to :none" do expect(event.name).to eql(:none) end it "sets silent to false"do expect(event.silent).to eql(false) end end context "with custom data" do let(:options) { {silent: true, name: name} } it "sets name to :green" do expect(event.name).to eql(name) end it "sets silent to true"do expect(event.silent).to eql(true) end end it "freezes object" do expect { event.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/event/initialize_spec.rb |
finite_machine-0.10.1 | spec/unit/event/initialize_spec.rb |