Sha256: 139011cd07169d9826da8c3f03f8d081cd00c407c50ffdbd8d331cb47cd40454

Contents?: true

Size: 940 Bytes

Versions: 30

Compression:

Stored size: 940 Bytes

Contents

require_relative "../spec_helper"

describe "path_matchers plugin" do 
  it ":extension matcher should match given file extension" do
    app(:path_matchers) do |r|
      r.on "css" do
        r.on :extension=>"css" do |file|
          file
        end
      end
    end

    body("/css/reset.css").must_equal 'reset'
    status("/css/reset.bar").must_equal 404
  end

  it ":suffix matcher should match given suffix" do
    app(:path_matchers) do |r|
      r.on "css" do
        r.on :suffix=>".css" do |file|
          file
        end
      end
    end

    body("/css/reset.css").must_equal 'reset'
    status("/css/reset.bar").must_equal 404
  end

  it ":prefix matcher should match given prefix" do
    app(:path_matchers) do |r|
      r.on "css" do
        r.on :prefix=>"reset" do |file|
          file
        end
      end
    end

    body("/css/reset.css").must_equal '.css'
    status("/css/foo.bar").must_equal 404
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
roda-3.28.0 spec/plugin/path_matchers_spec.rb
roda-3.27.0 spec/plugin/path_matchers_spec.rb
roda-3.26.0 spec/plugin/path_matchers_spec.rb
roda-3.25.0 spec/plugin/path_matchers_spec.rb
roda-3.24.0 spec/plugin/path_matchers_spec.rb
roda-3.23.0 spec/plugin/path_matchers_spec.rb
roda-3.22.0 spec/plugin/path_matchers_spec.rb
roda-3.21.0 spec/plugin/path_matchers_spec.rb
roda-3.20.0 spec/plugin/path_matchers_spec.rb
roda-3.19.0 spec/plugin/path_matchers_spec.rb
roda-3.18.0 spec/plugin/path_matchers_spec.rb
roda-3.17.0 spec/plugin/path_matchers_spec.rb
roda-3.16.0 spec/plugin/path_matchers_spec.rb
roda-3.15.0 spec/plugin/path_matchers_spec.rb
roda-3.14.1 spec/plugin/path_matchers_spec.rb
roda-3.14.0 spec/plugin/path_matchers_spec.rb
roda-3.13.0 spec/plugin/path_matchers_spec.rb
roda-3.12.0 spec/plugin/path_matchers_spec.rb
roda-3.11.0 spec/plugin/path_matchers_spec.rb
roda-3.10.0 spec/plugin/path_matchers_spec.rb