spec/ruhl_spec.rb in ruhl-0.11.2 vs spec/ruhl_spec.rb in ruhl-0.12.0

- old
+ new

@@ -325,19 +325,41 @@ should == "ecruos nepo" end end end + + + describe "collection_of_hashes.html" do + describe "user_list is not empty" do + before do + @html = File.read html(:collection_of_hashes) + @doc = create_doc + end + + + it "should have option for each state" do + options = @doc.xpath('/html/body/select//option') + options.children.length.should == @co.state_options.length + end + end + end + describe "special.html" do before do @html = File.read html(:special) @doc = create_doc end it "will convert entities" do - ps = @doc.xpath("/html/body//p") - ps[0].inner_html.should == "Here is a space&nbsp;and another&nbsp;one." + ps = @doc.xpath("/html/body/p") + ps[0].inner_html.should =~ /^Here is a space&nbsp;and another&nbsp;one.$/ ps[1].inner_html.should == "RuHL &copy; 2009" + + # To verify everything is correct, I did it the old fashioned way + # File.open('test.html',"w") do |f| + # f << @doc.to_s + # end end end describe "when no method" do before do