Sha256: da8dc38c0a9c535d9de5ba1576332d8b019da837e65c2b6d338b74fe22e76928
Contents?: true
Size: 1.09 KB
Versions: 5
Compression:
Stored size: 1.09 KB
Contents
require 'spec_helper' describe "ManyNode#inspect" do include TestParserGenerator def basic_many_parser new_parser do rule :foobar, many("foo", ",") end end def inspect_test(a,options={}) a.inspect(options).rstrip.gsub(/[ \t]+\n/,"\n")+"\n" end it "with no options should look like this" do basic_many_parser test_parse("foo").inspect.should == 'FoobarNode1 > "foo"' inspect_test(test_parse("foo,foo,foo")).should == <<ENDINSPECT FoobarNode1 "foo" "foo" "foo" ENDINSPECT end it "with :simple=>true should look like this" do basic_many_parser test_parse("foo").inspect(:simple=>true).should == 'FoobarNode1 > "foo"' inspect_test(test_parse("foo,foo,foo"),:simple=>true).should == <<ENDINSPECT FoobarNode1 "foo" "foo" "foo" ENDINSPECT end it "with :verbose=>true should look like this" do basic_many_parser test_parse("foo").inspect(:verbose=>true).should == 'FoobarNode1 > "foo"' inspect_test(test_parse("foo,foo,foo"),:verbose=>true).should == <<ENDINSPECT FoobarNode1 "foo" "," "foo" "," "foo" ENDINSPECT end end
Version data entries
5 entries across 5 versions & 1 rubygems