Sha256: 04ad8b45ba068d70c75842aa00b2b91d194623421195e5fa9f4377a83b2b86a6
Contents?: true
Size: 922 Bytes
Versions: 3
Compression:
Stored size: 922 Bytes
Contents
# encoding: utf-8 require 'spec_helper' describe FiniteMachine::Event, '#next_transition' do let(:object) { described_class } subject(:event) { object.new(machine, name: :test) } describe "matches transition by name" do let(:machine) { double(:machine) } it "finds matching transition" do transition_a = double(:transition_a, current?: false) transition_b = double(:transition_b, current?: true) event << transition_a event << transition_b expect(event.next_transition).to eq(transition_b) end end describe "fails to find" do let(:machine) { double(:machine) } it "choses first available transition" do transition_a = double(:transition_a, current?: false) transition_b = double(:transition_b, current?: false) event << transition_a event << transition_b expect(event.next_transition).to eq(transition_a) end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
finite_machine-0.10.0 | spec/unit/event/next_transition_spec.rb |
finite_machine-0.9.2 | spec/unit/event/next_transition_spec.rb |
finite_machine-0.9.1 | spec/unit/event/next_transition_spec.rb |