Sha256: efbc13e2887b78382056683d2e4a72ce79109a7a866a6115a24d966e13f24a6d

Contents?: true

Size: 519 Bytes

Versions: 1

Compression:

Stored size: 519 Bytes

Contents

require File.expand_path("spec_helper", File.dirname(File.dirname(__FILE__)))

describe "pass plugin" do 
  it "skips the current block if pass is called" do
    app(:pass) do |r|
      r.on :id do |id|
        r.pass if id == 'foo'
        id
      end

      r.on ":x/:y" do |x, y|
        x + y
      end
    end

    body("/a").should == 'a'
    body("/a/b").should == 'a'
    body("/foo/a").should == 'fooa'
    body("/foo/a/b").should == 'fooa'
    status("/foo").should == 404
    status.should == 404
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
roda-cj-0.9.3 spec/plugin/pass_spec.rb