Sha256: 055979f970f5105920da6c0ff77634d3a305e8e9739ca0cc6c48e482aad31f96

Contents?: true

Size: 638 Bytes

Versions: 8

Compression:

Stored size: 638 Bytes

Contents

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

test "matching an empty segment" do
  Cuba.define do
    on "" do
      res.write req.path
    end
  end

  env = {
    "SCRIPT_NAME" => "",
    "PATH_INFO" => "/"
  }

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

  assert_equal ["/"], resp.body
end

test "nested empty segments" do
  Cuba.define do
    on "" do
      on "" do
        on "1" do
          res.write "IT WORKS!"
          res.write req.path
        end
      end
    end
  end

  env = {
    "SCRIPT_NAME" => "",
    "PATH_INFO" => "///1"
  }

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

  assert_equal ["IT WORKS!", "///1"], resp.body
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
cuba-3.0.0.rc2 test/root.rb
cuba-3.0.0.rc1 test/root.rb
cuba-2.2.1 test/root.rb
cuba-2.2.0 test/root.rb
cuba-2.2.0.rc1 test/root.rb
cuba-2.1.0 test/root.rb
cuba-2.1.0.rc1 test/root.rb
cuba-2.0.1 test/root.rb