Permalink
Browse files

Start testing validity.

  • Loading branch information...
1 parent a04e7b8 commit 0bae0d6e73836d3c9586455181b59058599db7d3 @threedaymonk threedaymonk committed Mar 21, 2012
Showing with 22 additions and 0 deletions.
  1. +4 −0 lib/sibyl/graph.rb
  2. +4 −0 lib/sibyl/unit.rb
  3. +14 −0 test/graph_test.rb
View
@@ -10,6 +10,10 @@ def initialize(source)
@metadata = extract_metadata(elements)
end
+ def valid?
+ true
+ end
+
private
def parse(source)
parser = Sibyl::Parser.new
View
@@ -84,6 +84,10 @@ def compute(input, context)
end
end
+ class Outcome < Node
+ construct_with :name
+ end
+
class Go < Node
construct_with :target
View
@@ -19,4 +19,18 @@ def graph(source)
assert_equal expected, g.metadata
end
+
+ it "should be valid" do
+ g = graph(%{
+ step number a
+ go -> b
+ outcome b
+ })
+
+ assert g.valid?
+ end
+
+ it "should be invalid if a step is unreachable"
+ it "should be invalid if a target is unresolved"
+ it "should be invalid if there are no steps"
end

0 comments on commit 0bae0d6

Please sign in to comment.