Sha256: ce7d1bbdca1ed78a5aedebbd37308a5506b5f6f5b6909d399e652aaa951c7770

Contents?: true

Size: 1.14 KB

Versions: 3

Compression:

Stored size: 1.14 KB

Contents

require "spec_helper"

describe ImageFileList do
  describe "#to_css" do
    it "should handle mapping a prefix to autogenerated CSS classes" do
      ImageFileList.new('spec/samples/example.gif').to_css('premium', false).should match(/\.premium-example \{/)
    end
    it "should add a generator message to the top of files by default" do
      ImageFileList.new().to_css().split('\n').first.should eq("/* Generated with CSSquirt! (http://github.com/mroth/cssquirt/) */\n")
    end
    it "should allow the generator message to be disabled" do
      ImageFileList.new().to_css(nil, false).split('\n').first.should_not eq("/* Generated with CSSquirt! (http://github.com/mroth/cssquirt/) */\n")
    end
  end

  describe "#to_images" do
    it "should return an array of all ImageFiles" do
      fl = ImageFileList.new('spec/samples/*.png', 'spec/samples/*.gif').to_images
      fl.each { |file| file.should be_kind_of(ImageFile) }
    end
    it "should eat Exceptions and output errors to STDERR instead" do
      bad_eggs = 'spec/samples/*.mp3', 'spec/samples/toobig.gif'
      lambda { ImageFileList.new(bad_eggs).to_images }.should_not raise_error
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cssquirt-0.0.2 spec/file_list_spec.rb
cssquirt-0.0.1 spec/file_list_spec.rb
cssquirt-0.0.1.pre.1 spec/file_list_spec.rb