Sha256: 4434168672777fa95e9200ab4d768de185d408f0515a682d1626f2fe19bfea65

Contents?: true

Size: 738 Bytes

Versions: 5

Compression:

Stored size: 738 Bytes

Contents

require File.expand_path('../test_helper', __FILE__)

class OptionsTest < UnitTest
  class App < Main
    assets {
      css :application, [ '/css/*.css' ]
      js_compression :closure
    }
  end

  def app
    App
  end

  test "options" do
    assert App.assets.js_compression == :closure
    assert App.assets.packages['application.css'].path == "/assets/application.css"
  end

  test "serve requires :from parameter" do
    err = assert_raise ArgumentError do
      App.assets.serve "/foo"
    end
    assert_equal "Parameter :from is required", err.message
  end

  test "serve requires :from to be directory" do
    e = assert_raise Errno::ENOTDIR do
      App.assets.serve "/foo", :from => "/does/not/exist"
    end
  end


end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
sinatra-assetpack-0.3.5 test/options_test.rb
sinatra-assetpack-0.3.3 test/options_test.rb
sinatra-assetpack-0.3.2 test/options_test.rb
sinatra-assetpack-0.3.1 test/options_test.rb
sinatra-assetpack-0.3.0 test/options_test.rb