spec/unit/tongo_parser_spec.rb in tongo-0.0.1 vs spec/unit/tongo_parser_spec.rb in tongo-0.0.2

- old
+ new

@@ -1,11 +1,11 @@ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe Tongo::Parser do def compiled(src) - Tongo::Parser.new.compile(src) + Tongo::Parser.new.call(src) end it { compiled("Plain text").should == [:multi, [:text, "Plain text"]] } it { compiled("<h1>Header</h1>").should == [:multi, [:html, "h1", {}, [:multi, [:text, "Header"]]]] } it { compiled("<tng:test />").should == [:multi, [:empty, 'test', {}]]} @@ -25,7 +25,7 @@ it { compiled("<a href=\"/\">link</a>").should == [:multi, [:html, 'a', {"href" => "/"}, [:multi, [:text, 'link']]]] } it { compiled("<tng:loop times=\"3\">test</tng:loop>").should == [:multi, [:nested, 'loop', {"times" => "3"}, [:multi, [:text, 'test']]]] } end describe Tongo::Parser, "with a custom namespace" do - it { Tongo::Parser.new(:ns => 'pop').compile('<pop:custom />').should == [:multi, [:empty, 'custom', {}]] } + it { Tongo::Parser.new(:ns => 'pop').call('<pop:custom />').should == [:multi, [:empty, 'custom', {}]] } end \ No newline at end of file