Sha256: 0a17d2841f7ac8799dc5bc9060d8b960d5169e52531c5eee5ee1bddfbcc53800

Contents?: true

Size: 1.09 KB

Versions: 2

Compression:

Stored size: 1.09 KB

Contents

require 'spec_helper'

describe Roadie do
  describe ".inline_css" do
    it "should create an instance of Roadie::Inliner and execute it" do
      Roadie::Inliner.should_receive(:new).with('attri', 'butes').and_return(double('inliner', :execute => 'html'))
      Roadie.inline_css('attri', 'butes').should == 'html'
    end
  end

  describe ".load_css(root, targets)" do
    let(:fixtures_root) { Pathname.new(__FILE__).dirname.join('..', 'fixtures') }

    it "should load files matching the target names under root/public/stylesheets" do
      Roadie.load_css(fixtures_root, ['foo']).should == 'contents of foo'
    end

    it "should load files in order and join them with a newline" do
      Roadie.load_css(fixtures_root, %w[foo bar]).should == "contents of foo\ncontents of bar"
      Roadie.load_css(fixtures_root, %w[bar foo]).should == "contents of bar\ncontents of foo"
    end

    it "should raise a Roadie::CSSFileNotFound error when a css file could not be found" do
      expect { Roadie.load_css(fixtures_root, ['not_here']) }.to raise_error(Roadie::CSSFileNotFound, /not_here/)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
roadie-1.0.0.pre2 spec/lib/roadie_spec.rb
roadie-1.0.0.pre1 spec/lib/roadie_spec.rb