# encoding: utf-8 require 'spec_helper' describe ClassyAssets::Config do before(:all) do @asset_prefix = 'assets' @asset_root = File.expand_path('../../support', __FILE__) @asset_host = 'http://example.com' @asset_public_path = File.join(@asset_root, 'public') @asset_precompile_path = File.join(@asset_public_path, @asset_prefix) @asset_manifest_path = File.join(@asset_precompile_path, 'manifest.json') @asset_precompile = %w(application.css application.js) @asset_version = ClassyAssets::VERSION @asset_paths = Dir.glob(File.join(@asset_root, @asset_prefix, '*')) @vendor_path = File.expand_path('../../support/vendor', __FILE__) @asset_paths << @vendor_path ClassyAssets.config do |config| config.asset_root = @asset_root # must be configured first config.asset_debug = true config.asset_digest = true config.asset_host = @asset_host config.asset_paths << @vendor_path config.asset_precompile = @asset_precompile end @configuration = ClassyAssets.config end it "returns the configured asset_cache" do @configuration.asset_cache.must_equal false end it "returns the configured asset_compress" do @configuration.asset_compress.must_equal nil end it "returns the configured asset_debug" do @configuration.asset_debug.must_equal true end it "returns the configured asset_digest" do @configuration.asset_digest.must_equal true end it "returns the configured asset_host" do @configuration.asset_host.must_equal @asset_host end it "returns the configured asset_manifest_path" do @configuration.asset_manifest_path.must_equal @asset_manifest_path end it "returns the configured asset_paths" do @configuration.asset_paths.must_equal @asset_paths end it "returns the configured asset_precompile" do @configuration.asset_precompile.must_equal @asset_precompile end it "returns the configured asset_precompile_keep" do @configuration.asset_precompile_keep.must_equal 2 end it "returns the configured asset_precompile_path" do @configuration.asset_precompile_path.must_equal @asset_precompile_path end it "returns the configured asset_prefix" do @configuration.asset_prefix.must_equal @asset_prefix end it "returns the configured asset_public_path" do @configuration.asset_public_path.must_equal @asset_public_path end it "returns the configured asset_root" do @configuration.asset_root.must_equal @asset_root end it "returns the configured asset_version" do @configuration.asset_version.must_equal @asset_version end it "returns the configured css_compressor" do @configuration.css_compressor.must_equal :yui end it "returns the configured js_compressor" do @configuration.js_compressor.must_equal :uglifier end end