Sha256: c733928a57c69235fadea0d40f7f47d6e4a262b40c879e59fcd3a151bbe4dff6
Contents?: true
Size: 590 Bytes
Versions: 17
Compression:
Stored size: 590 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 BlockTreeNodeVisitor do accumulator = [] visitor = BlockTreeNodeVisitor.new { |node| accumulator << node.content} @tree.accept( visitor ) accumulator.length.should == 5 accumulator.should == %w{ a 1 2 b 3 } end end
Version data entries
17 entries across 17 versions & 2 rubygems