Sha256: f3ae8a2b706c8b2da8ceb99d62df237c805cffefed77c9becf9d7dfe99128b05
Contents?: true
Size: 1.03 KB
Versions: 4
Compression:
Stored size: 1.03 KB
Contents
require File.expand_path('../test_helper', __FILE__) class GlobTest < UnitTest class App < Main assets { serve '/js', :from => 'app/js_glob' js :a, '/a.js', [ '/js/**/*.js' ] js :b, '/b.js', [ '/js/a/b/c2/*.js' ] js :c, '/c.js', [ '/js/a/b/*/*.js' ] } get('/a') { js :a } get('/b') { js :b } get('/c') { js :c } end def app App end should "match double-star globs recursively" do app.stubs(:development?).returns(true) get '/a' assert body.include?("a/b/c1/hello.") assert body.include?("a/b/c2/hi.") assert body.include?("a/b/c2/hola.") end should "match single-star globs in filenames" do app.stubs(:development?).returns(true) get '/b' assert body.include?("a/b/c2/hi.") assert body.include?("a/b/c2/hola.") end should "match single-star globs in paths" do app.stubs(:development?).returns(true) get '/c' assert body.include?("a/b/c1/hello.") assert body.include?("a/b/c2/hi.") assert body.include?("a/b/c2/hola.") end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
sinatra-assetpack-0.2.6 | test/glob_test.rb |
sinatra-assetpack-0.2.5 | test/glob_test.rb |
sinatra-assetpack-0.2.4 | test/glob_test.rb |
sinatra-assetpack-0.2.3 | test/glob_test.rb |