Skip to content
Browse files

Improve test coverage for FSM#transition

  • Loading branch information...
1 parent 0f17368 commit 4cac88907a367d7a31b1a91e2540d58797394cef Joey Butler committed Oct 2, 2012
Showing with 13 additions and 0 deletions.
  1. +13 −0 spec/celluloid/fsm_spec.rb
View
13 spec/celluloid/fsm_spec.rb
@@ -94,4 +94,17 @@ class CustomDefaultMachine
end
end
end
+
+ context "transitioning to an invalid state" do
+ let(:subject) { TestMachine.new }
+
+ it "raises an argument error" do
+ expect { subject.transition :invalid_state }.to raise_error(ArgumentError)
+ end
+
+ it "should not call transition! if the state is :default" do
+ subject.should_not_receive :transition!
+ subject.transition :default
+ end
+ end
end

0 comments on commit 4cac889

Please sign in to comment.
Something went wrong with that request. Please try again.