Created
November 8, 2009 18:10
-
-
Save jcbozonier/229409 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| describe "When building a three pattern with a match any multiple in the middle" do | |
| before(:each) do | |
| @state_builder = StateBuilder.new | |
| @string_reader = StringReader.new("a*.") | |
| @graph = @state_builder.create_from(@string_reader) | |
| end | |
| it "should return a five state graph" do | |
| @graph.transitions[0].destination.transitions[0].destination.transitions[0].destination.transitions[0].destination.should_not == nil | |
| end | |
| it "should start with a start state" do | |
| @graph.class.should == StartState | |
| end | |
| it "should have a standard state as the 2nd state" do | |
| @graph.transitions[0].destination.class.should == StandardState | |
| end | |
| it "should have a standard state as the 3rd state" do | |
| @graph.transitions[0].destination.transitions[0].destination.class.should == StandardState | |
| end | |
| it "should have a standard state as the 4th state" do | |
| @graph.transitions[0].destination.transitions[0].destination.transitions[0].destination.class.should == StandardState | |
| end | |
| it "should have a terminal state as the 5th state" do | |
| @graph.transitions[0].destination.transitions[0].destination.transitions[1].destination.transitions[0].destination.class.should == TerminalState | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment