Sha256: 2143828812fe03045ae91793ab04cb05edfdc62f15ca3eacd9dbfa354dc5f563

Contents?: true

Size: 525 Bytes

Versions: 1

Compression:

Stored size: 525 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

describe "HtmlCssDecorator" do
  it "works" do
    doc = Nokogiri::HTML(File.open 'fixtures/test.html')    
    doc = CSS::Model.apply_to(doc, :css_path => File.dirname(__FILE__) + "/fixtures/")
        
    doc.css('*').each do |elem|  
      puts show(elem) if elem.declarations
    end
  end
end    

def show(elem)
  s = "Tag: #{elem.name}\n"
  return s if !elem.declarations
  elem.declarations.each do |decl|
    s += decl[1].to_text
  end    
  s
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
html_css_decorator-0.1.2 spec/html_css_decorator_spec.rb