Permalink
Browse files

Added fail test for scenario when a rule prerequisite has outputs. Th…

…e target should be connected to the outputs, not the recipe prerequisite.
  • Loading branch information...
1 parent 2a3e80a commit 308ef39be3704926f5abdf5b3583047441e7e830 @KrisJordan committed Jan 4, 2011
Showing with 26 additions and 1 deletion.
  1. +26 −1 spec/rules.vows.coffee
View
@@ -54,7 +54,7 @@ vows
topic: (graph) -> graph.nodes.ofType FileNode
'of length 1': (files) ->
assert.length files.items, 1
- 'A RuleGraph f([A]) -> B=>c':
+ 'A RuleGraph f([A]) -> B=>C':
topic: ->
graph = new RuleGraph
graph.rule new Rule 'B', ['A'], new Recipe (->), (->['C'])
@@ -80,5 +80,30 @@ vows
to = _(arcs.pluck 'to').pluck 'name'
['B','C'].forEach (item) ->
assert.includes to, item
+ 'A RuleGraph f([A])->B=>C, f([B])->D':
+ topic: ->
+ graph = new RuleGraph
+ graph.rule new Rule 'B', ['A'], new Recipe (->), (->['C'])
+ graph.rule new Rule 'D', ['B'], (->)
+ 'has RecipeNodes':
+ topic: (graph) -> graph.nodes.ofType RecipeNode
+ 'of length 2': (recipes) ->
+ assert.length recipes.items, 2
+ 'has FileNodes':
+ topic: (graph) -> graph.nodes.ofType FileNode
+ 'of length 2': (files) ->
+ assert.length files.items, 2
+ 'has Arcs':
+ topic: (graph) -> graph.arcs
+ 'of length 3': (arcs) ->
+ assert.length arcs.items, 3
+ 'from A,B,C': (arcs) ->
+ from = _(arcs.pluck 'from').pluck 'name'
+ ['A','B','C'].forEach (item) ->
+ assert.includes from, item
+ 'to B,C,D': (arcs) ->
+ to = _(arcs.pluck 'to').pluck 'name'
+ ['B','C','D'].forEach (item) ->
+ assert.includes to, item
)
.export(module)

0 comments on commit 308ef39

Please sign in to comment.