Sha256: 8d91e9d18e799a2a2d68540375e5c6d06c40611237197fd96439d0bde4afab20

Contents?: true

Size: 616 Bytes

Versions: 10

Compression:

Stored size: 616 Bytes

Contents

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

setup do
  { "SCRIPT_NAME" => "/", "PATH_INFO" => "/about/1/2" }
end

test "paths and numbers" do |env|
  Cuba.define do
    on "about" do
      on :one, :two do |one, two|
        res.write one
        res.write two
      end
    end
  end

  _, _, resp = Cuba.call(env)

  assert_equal ["1", "2"], resp.body
end

test "paths and decimals" do |env|
  Cuba.define do
    on "about" do
      on /(\d+)/ do |one|
        res.write one
      end
    end
  end

  env["PATH_INFO"] = "/about/1.2"

  _, _, resp = Cuba.call(env)

  assert_equal [], resp.body
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
cuba-2.2.1 test/number.rb
cuba-2.2.0 test/number.rb
cuba-2.2.0.rc1 test/number.rb
cuba-2.1.0 test/number.rb
cuba-2.1.0.rc1 test/number.rb
cuba-2.0.1 test/number.rb
cuba-2.0.0 test/number.rb
cuba-2.0.0.rc3 test/number.rb
cuba-2.0.0.rc2 test/number.rb
cuba-2.0.0.rc1 test/number.rb