Permalink
Browse files

Merge pull request #1 from irickt/master

fixes for two api changes - thanks to @irickt
  • Loading branch information...
2 parents 619d185 + 8db48d2 commit 170af49d09b36124cf89ebcefe08cbfdbb69358e @KrisJordan committed Jan 25, 2012
Showing with 24 additions and 24 deletions.
  1. +1 −1 Cakefile
  2. +4 −4 lib/rules.js
  3. +5 −5 spec/dag.vows.coffee
  4. +13 −13 spec/rules.vows.coffee
  5. +1 −1 src/rules.coffee
View
@@ -11,7 +11,7 @@ task 'test', ['spec/*','src/*'], (options) ->
args.push '--spec'
tests = _(this.modifiedPrereqs).filter (prereq) -> prereq.match /^spec/
src = _(this.modifiedPrereqs).filter (prereq) -> prereq.match /^src/
- command = "vows #{args.join ' '} #{tests.join(' ')}"
+ command = "./node_modules/vows/bin/vows #{args.join ' '} #{tests.join(' ')}"
this.exec [
command
]
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -33,13 +33,13 @@ testGraph = (options) ->
focus.topic = graphFromMap options.graph
focus["has #{options.nodes.length} nodes: [#{options.nodes.join(',')}]"] = (graph) ->
- assert.length graph.nodes.items, options.nodes.length
+ assert.lengthOf graph.nodes.items, options.nodes.length
actualNodes = graph.nodes.pluck 'name'
options.nodes.forEach (node) ->
assert.include actualNodes, node
focus["has #{options.arcs} arcs"] = (graph) ->
- assert.length graph.arcs.items, options.arcs
+ assert.lengthOf graph.arcs.items, options.arcs
focus["does #{ if not options.hasCycle then "not " else "" }have a cycle"] = (graph) ->
assert.equal graph.hasCycle(), options.hasCycle
@@ -51,7 +51,7 @@ testGraph = (options) ->
if options.sources?
focus["has sources of length #{options.sources.length} containing [#{options.sources.join ','}]"] = (graph) ->
sources = graph.sources().pluck 'name'
- assert.length sources, options.sources.length
+ assert.lengthOf sources, options.sources.length
options.sources.forEach (source) ->
assert.include sources, source
@@ -133,7 +133,7 @@ vows
'has a node list':
topic: (graph) -> graph.nodes
'with one element': (nodes) ->
- assert.length nodes.items, 1
+ assert.lengthOf nodes.items, 1
)
.export(module)
@@ -143,7 +143,7 @@ vows
'A List':
topic: new List
'has no nodes': (list) ->
- assert.length list.items, 0
+ assert.lengthOf list.items, 0
)
.export(module)
View
@@ -11,34 +11,34 @@ vows
'A RuleGraph':
topic: new RuleGraph
'is empty': (graph) ->
- assert.length graph.nodes.items, 0
+ assert.lengthOf graph.nodes.items, 0
'A RuleGraph f([]) -> A':
topic: ->
graph = new RuleGraph
graph.rule new Rule 'A',[],(->)
'has 1 node that is a RecipeNode': (graph) ->
- assert.length graph.nodes.items, 1
+ assert.lengthOf graph.nodes.items, 1
assert.isTrue graph.nodes.items[0] instanceof RecipeNode
'A RuleGraph f([A]) -> B':
topic: ->
graph = new RuleGraph
graph.rule new Rule 'B',['A'],(->)
'has 2 nodes A and B': (graph) ->
- assert.length graph.nodes.items, 2
+ assert.lengthOf graph.nodes.items, 2
'has nodes of type FileNode':
topic: (graph) -> graph.nodes.ofType FileNode
'of length 1 with name A': (files) ->
- assert.length files.items, 1
+ assert.lengthOf files.items, 1
assert.equal files.items[0].name, 'A'
'has nodes of type RecipeNode':
topic: (graph) -> graph.nodes.ofType RecipeNode
'of length 1 with name B': (recipes) ->
- assert.length recipes.items, 1
+ assert.lengthOf recipes.items, 1
assert.equal recipes.items[0].name, 'B'
'has arcs':
topic: (graph) -> graph.arcs.items
'of length 1, from A to B': (arcs) ->
- assert.length arcs, 1
+ assert.lengthOf arcs, 1
assert.equal arcs[0].from.name, 'A'
assert.equal arcs[0].to.name, 'B'
'A RuleGraph f([A]) -> B .. f([B]) -> C':
@@ -49,29 +49,29 @@ vows
'has RecipeNodes':
topic: (graph) -> graph.nodes.ofType RecipeNode
'of length 2': (recipes) ->
- assert.length recipes.items, 2
+ assert.lengthOf recipes.items, 2
'has FileNodes':
topic: (graph) -> graph.nodes.ofType FileNode
'of length 1': (files) ->
- assert.length files.items, 1
+ assert.lengthOf files.items, 1
'A RuleGraph f([A]) -> B=>C':
topic: ->
graph = new RuleGraph
graph.rule new Rule 'B', ['A'], new Recipe (->), (->['C'])
'has RecipeNodes':
topic: (graph) -> graph.nodes.ofType RecipeNode
'of length 1': (recipes) ->
- assert.length recipes.items, 1
+ assert.lengthOf recipes.items, 1
'has FileNodes':
topic: (graph) -> graph.nodes.ofType FileNode
'of length 2': (files) ->
- assert.length files.items, 2
+ assert.lengthOf files.items, 2
'containing C': (files) ->
assert.includes (files.pluck 'name'), 'C'
'has 2 arcs':
topic: (graph) -> graph.arcs
'of length 2': (arcs) ->
- assert.length arcs.items, 2
+ assert.lengthOf arcs.items, 2
'from A,B': (arcs) ->
from = _(arcs.pluck 'from').pluck 'name'
['A','B'].forEach (item) ->
@@ -90,11 +90,11 @@ vows
# 'has FileNodes':
# topic: (graph) -> graph.nodes.ofType FileNode
# 'of length 2': (files) ->
-# assert.length files.items, 2
+# assert.lengthOf files.items, 2
# 'has Arcs':
# topic: (graph) -> graph.arcs
# 'of length 3': (arcs) ->
-# assert.length arcs.items, 3
+# assert.lengthOf arcs.items, 3
# 'from A,B,B': (arcs) ->
# from = _(arcs.pluck 'from').pluck 'name'
# ['A','B','B'].forEach (item) ->
View
@@ -21,7 +21,7 @@
{ Graph, Node, Arc, NodeList } = require './dag'
_ = require 'underscore'
assert = require 'assert'
-{ globSync } = require 'glob'
+globSync = require( 'glob').sync
fs = require 'fs'
class RuleGraph extends Graph

0 comments on commit 170af49

Please sign in to comment.