Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added last test for now for steps transitions - all tests pass

  • Loading branch information...
commit 323530b946a7d33daddfe5b1ae277f7384887e66 1 parent e5e0c0a
@tallakt authored
Showing with 23 additions and 1 deletion.
  1. +23 −1 spec/step_base_spec.rb
View
24 spec/step_base_spec.rb
@@ -205,8 +205,30 @@ def run
run
end
+ def one_state_should_be_active
+ @s.should be_active unless @dummy.active?
+ @dummy.should be_active unless @s.active?
+ (@s || @dummy).should be_true
+ end
+
it 'should overlap the active signal of two consequitive states' do
- fail
+ @s.continue_if @p2, @dummy
+ [@s, @dummy].each do |state|
+ state.on_enter { one_state_should_be_active }
+ state.on_exit { one_state_should_be_active }
+ end
+ @s.start
+ one_state_should_be_active
+ current = Scheduler.current
+ Scheduler.class_eval do
+ alias :work_if_busy_orig :work_if_busy
+ end
+
+ current.stub!(:work_if_busy).and_return do
+ Scheduler.current.send(:work_if_busy_orig)
+ one_state_should_be_active
+ end
+ run
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.