Permalink
Browse files

correct spec

  • Loading branch information...
1 parent 2f71f3a commit 8c0f04f13fa91a646ecf2732bd58a5715ae1d523 @siuying committed May 24, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 spec/wakizashi_spec.rb
@@ -1,19 +1,19 @@
describe "Wakizashi" do
it "should parse html" do
- doc = Wakizashi.HTML("<p>Hello World</p>")
+ doc = Wakizashi::HTML("<p>Hello World</p>")
doc.is_a?(GDataXMLDocument).should.be.true
doc.rootElement.to_xml.should == "<html><body><p>Hello World</p></body></html>"
end
it "should parse xml" do
- doc = Wakizashi.XML("<p>Hello World</p>")
+ doc = Wakizashi::XML("<p>Hello World</p>")
doc.is_a?(GDataXMLDocument).should.be.true
doc.rootElement.to_xml.should == "<p>Hello World</p>"
end
it "should search document and modify content" do
html = "<html><body><h1>Hello World</h1><p>Welcome</p><p>Foo</p><a href='http://www.google.com'>Google</a></body></html>"
- doc = Wakizashi.HTML(html)
+ doc = Wakizashi::HTML(html)
link = doc.xpath("//a").first
link["href"].should == "http://www.google.com"
@@ -22,7 +22,7 @@
link["href"] = "http://wikipedia.org"
link.stringValue = "Wiki"
- link.to_html.should == "<html><body><h1>Hello World</h1><p>Welcome</p><p>Foo</p><a href=\"http://wikipedia.org\">Wiki</a></body></html>"
+ link.to_html.should == "<a href=\"http://wikipedia.org\">Wiki</a>"
end
end

0 comments on commit 8c0f04f

Please sign in to comment.