Sha256: d8aa9ab7ce6fd6fdd2fb3f17af4195b40884baa22a24f8a37302a2fc3d87d146
Contents?: true
Size: 617 Bytes
Versions: 17
Compression:
Stored size: 617 Bytes
Contents
# -*- coding: utf-8 -*- require File.join(File.dirname(__FILE__), "..", "..", "spec_helper") describe "Tree Node Visitors" do before do ta = TreeNode.new( "a", nil ) LeafNode.new("1", ta ) LeafNode.new("2", ta ) tb = TreeNode.new( "b", ta ) LeafNode.new( "3", tb ) @tree = ta end it DepthTreeNodeVisitor do visitor = DepthTreeNodeVisitor.new @tree.accept( visitor ) visitor.depth.should == 0 visitor = CloneTreeNodeVisitor.new @tree.accept( visitor ) visitor.cloned_root.nr_nodes.should == @tree.nr_nodes end end
Version data entries
17 entries across 17 versions & 2 rubygems