Sha256: 42360c508f902acc58cc4d5483bb5aa6107e9115f72a04a9fec0b3cff51a5b4a

Contents?: true

Size: 895 Bytes

Versions: 9

Compression:

Stored size: 895 Bytes

Contents

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

class ArityTest < UnitTest
  class App < UnitTest::App
    register Sinatra::AssetPack

    assets do |a|
      a.css :a, '/css/a.css', [
        '/css/s*.css',
        '/css/j*.css'
      ]

      a.js_compression :closure
      a.css_compression = :yui
    end
  end

  test "arity in #assets" do
    paths = App.assets.packages['a.css'].paths
    expect = [ "/css/screen.css", "/css/sqwishable.css", "/css/style.css", "/css/stylus.css", "/css/js2c.css" ]
    if RUBY_VERSION < "1.9"
      # In 1.8.7 glob returns inconsitent files order so just check array are equivalents
      assert_equal expect.size, paths.size
      assert_equal 0, paths.reject{ |p| expect.include?(p) }.size
    else
      assert_equal expect, paths
    end

    assert App.assets.js_compression == :closure
    assert App.assets.css_compression == :yui
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
sinatra-assetpack-0.2.2 test/arity_test.rb
sinatra-assetpack-0.2.1 test/arity_test.rb
sinatra-assetpack-0.2.0 test/arity_test.rb
sinatra-assetpack-0.1.7 test/arity_test.rb
sundawg-sinatra-assetpack-fork-0.1.6 test/arity_test.rb
sinatra-assetpack-0.1.6 test/arity_test.rb
sinatra-assetpack-0.1.5 test/arity_test.rb
sinatra-assetpack-0.1.4 test/arity_test.rb
sinatra-assetpack-0.1.3 test/arity_test.rb