Sha256: b7aeb572a68488ea2b2df49d1c79b81a26510b29fafefd547502fed94fe5fc93

Contents?: true

Size: 670 Bytes

Versions: 4

Compression:

Stored size: 670 Bytes

Contents

# -*- encoding: utf-8 -*-

require './spec/helper'

describe Builder do

  before :all do
    @template = Nokogiri::HTML(File.open("data/templates/main.html"))
  end

  it "should replace a css rule by a string" do
    builder = Builder.new(@template)
    doc = builder.replace('genit.pages', "<working />")
    doc.css("body working").size.should == 1
  end
  
  it "should set the menu" do
    menu = Nokogiri::XML(File.open("data/templates/menu.html"))
    builder = Builder.new(menu)
    menu = builder.select_menu('index.html')
    menu.css("ul#menu a#selected").size.should == 1
    menu.css("ul#menu a#selected").first['href'].should == 'index.html'
  end
  
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
genit-0.4.1 spec/builder_spec.rb
genit-0.4 spec/builder_spec.rb
genit-0.3 spec/builder_spec.rb
genit-0.2 spec/builder_spec.rb