Sha256: 342cc4abadbf837501cf614bc8cdcec0598451f51a6e9445bfa34df8a82c592a

Contents?: true

Size: 849 Bytes

Versions: 1

Compression:

Stored size: 849 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

describe "SgfParser::Tree" do


  it "should load a file properly" do
    tree = SGF::Parser.new('spec/data/ff4_ex.sgf').parse
    tree.class.should == SGF::Tree
    tree.root.children.size.should == 2
    tree.root.children[0].children.size.should == 5
  end

  it "should save a simple tree properly" do
    tree = SGF::Parser.new('spec/data/simple.sgf').parse
    new_file = 'spec/data/simple_saved.sgf'
    tree.save :filename => new_file
    tree2 = SGF::Parser.new(new_file).parse
    tree.should == tree2
  end

  it "should save the sample SGF properly" do
    tree = SGF::Parser.new('spec/data/ff4_ex.sgf').parse
    new_file = 'spec/data/ff4_ex_saved.sgf'
    tree.save :filename => new_file
    tree2 = SGF::Parser.new(new_file).parse
    tree2.should == tree
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
SgfParser-1.0.0 spec/tree_spec.rb