Sha256: 599a4831861add4e9de1f23e57e25e36eeb804277a63da527362adfd29dd945d

Contents?: true

Size: 997 Bytes

Versions: 5

Compression:

Stored size: 997 Bytes

Contents

require 'spec_helper'

describe StyleSheet do

  it "outputs a proper tag" do
    sh = StyleSheet.new
    sh.name = "test.css"
    sh.url = "http://localhost:3000/styles"
    tag = sh.to_tag
    tag.should eq '<link href="http://localhost:3000/styles/test.css" media="screen" rel="stylesheet" type="text/css">'
  end

  it "strips attributes from a given tag" do
    sh = StyleSheet.new
    sh.from_tag "<link href=\"https://a248.e.akamai.net/assets.github.com/assets/github-6c7984e384129edf1958345326c26471eedcdc23.css\" media=\"screen\" rel=\"stylesheet\" type=\"text/css\">\n"

    sh.name.should eq "github-6c7984e384129edf1958345326c26471eedcdc23.css"
    sh.url.should eq "https://a248.e.akamai.net/assets.github.com/assets"
  end

  it "loads web content" do
    sh = StyleSheet.new
    sh.from_tag '<link href="http://dev.knomedia.com/hubdown_css/test.css" media="screen" rel="stylesheet" type="text/css">'
    sh.download_content
    sh.content.should eq "body { margin: 0; }"
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
hubdown-0.0.12 spec/style_sheet_spec.rb
hubdown-0.0.11 spec/style_sheet_spec.rb
hubdown-0.0.10 spec/style_sheet_spec.rb
hubdown-0.0.9 spec/style_sheet_spec.rb
hubdown-0.0.8 spec/style_sheet_spec.rb