Sha256: 4f9a37abef744b6b17650fe5b5efa99505e9c1bce8ca6a9b913ceb2121e03dc1

Contents?: true

Size: 1.04 KB

Versions: 23

Compression:

Stored size: 1.04 KB

Contents

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

describe Assette::Reader do
  
  before(:all) do
    
    class Assette::Reader::Txt < Assette::Reader(:txt)
      def compile
        @file.text
      end
    end
    
  end
  
  it "should set outputs on creation" do
    Assette::Reader::Txt.outputs.should == :txt
  end
  
  it "should make the reader map" do
    Assette::Reader::ALL.should include('txt' => Assette::Reader::Txt)
  end
  
  it "should have mime type" do
    Assette::Reader::Txt.mime_type.should == MIME::Types.type_for("test.txt").first
  end
  
  it "should build the right target list" do
    targets = Assette::Reader.possible_targets('/test/.hidden/one.file.css')
    %w{
      /test/.hidden/one.file.css
      /test/.hidden/one.file.sass
      /test/.hidden/one.file.scss
    }.each do |p|
      targets.should include p
    end
    
    targets = Assette::Reader.possible_targets('/test/.hidden/file.js')
    targets.should include "/test/.hidden/file.js"
    targets.should include "/test/.hidden/file.coffee"
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
assette-0.1.8 spec/reader_spec.rb
assette-0.1.7 spec/reader_spec.rb
assette-0.1.6 spec/reader_spec.rb
assette-0.1.5 spec/reader_spec.rb
assette-0.1.4 spec/reader_spec.rb
assette-0.1.3 spec/reader_spec.rb
assette-0.1.2 spec/reader_spec.rb
assette-0.1.1 spec/reader_spec.rb
assette-0.1.0 spec/reader_spec.rb
assette-0.0.13 spec/reader_spec.rb
assette-0.0.12 spec/reader_spec.rb
assette-0.0.11 spec/reader_spec.rb
assette-0.0.10 spec/reader_spec.rb
assette-0.0.9 spec/reader_spec.rb
assette-0.0.8 spec/reader_spec.rb
assette-0.0.7 spec/reader_spec.rb
assette-0.0.6 spec/reader_spec.rb
assette-0.0.5 spec/reader_spec.rb
assette-0.0.4 spec/reader_spec.rb
assette-0.0.3 spec/reader_spec.rb