Sha256: c9dad87f0da8959f7512ce714559b34c878191189f5eefdf1953ebb147b72cb1

Contents?: true

Size: 1.24 KB

Versions: 22

Compression:

Stored size: 1.24 KB

Contents

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

describe Assette::Config do
  
  before do
    Assette.instance_variable_set :@config, nil
  end
  
  it "should recieve correct file" do
    Assette::Config.should_receive(:load).once.with('config/assets.rb')
    
    Dir.chdir(File.dirname(__FILE__) + '/../examples') { Assette.config }
  end
  
  describe "default file" do
    before(:all) do
      @dir_before = Dir.pwd
      Dir.chdir(File.dirname(__FILE__) + '/../examples')
    end

    after(:all) do
      Dir.chdir(@dir_before)
    end
    
    subject {Assette.config}

    it "should set file paths" do
      subject.file_paths.should == %w{public foo}
    end

    it "should set asset hosts" do
      subject.asset_hosts.should == %w{http://cdn1.gilt.com http://cdn2.gilt.com}
    end
    
    it "should set assets dir" do
      subject.asset_dir.should == 'myassets'
    end
    
    it "should set templates path" do
      subject.templates_path.should == 'myapp/templates'
    end
    
    it "should set templates format" do
      subject.template_format.should == 'GC.foo.t[{*path*}] = Handlebars.compile({*template*});'
    end
    
    it "should set after compile" do
      subject.after_compile.call.should == 3
    end
  end
  
end

Version data entries

22 entries across 22 versions & 1 rubygems

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