Sha256: 7b438f599ef4991996e84b5fd9fb46a656529fbce405c4a19ecff2cadf1c0b6f
Contents?: true
Size: 605 Bytes
Versions: 11
Compression:
Stored size: 605 Bytes
Contents
# -*- encoding: utf-8 -*- require './spec/helper' require 'nokogiri' describe "Nokogiri library" do before :all do f = File.open("data/templates/main.html") @doc = Nokogiri::HTML(f) f.close end it "should retrieve all genit tag" do @doc.css("body genit").size.should == 2 end it "should retrieve class of tag" do tags = @doc.css("body genit") tags[0]['class'].should == "menu" tags[1]['class'].should == "pages" end it "should add an attribute" do @doc.at_css("body")['class'] = "main" @doc.at_css("body")['class'].should == 'main' end end
Version data entries
11 entries across 11 versions & 1 rubygems