Sha256: b52f1ab12dfdfa6406f86cdd8e429e1301283de4bc9d5a8c010a005579eaad5b

Contents?: true

Size: 519 Bytes

Versions: 25

Compression:

Stored size: 519 Bytes

Contents

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

test "matches a host" do
  Cuba.define do
    on host("example.com") do
      res.write "worked"
    end
  end

  env = { "HTTP_HOST" => "example.com" }

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

  assert_response resp, ["worked"]
end

test "matches a host with a regexp" do
  Cuba.define do
    on host(/example/) do
      res.write "worked"
    end
  end

  env = { "HTTP_HOST" => "example.com" }

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

  assert_response resp, ["worked"]
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
cuba-4.0.3 test/host.rb
cuba-4.0.1 test/host.rb
cuba-4.0.0 test/host.rb
cuba-3.9.3 test/host.rb
cuba-3.9.2 test/host.rb
cuba-3.9.1 test/host.rb
cuba-3.9.0 test/host.rb
cuba-3.8.1 test/host.rb
cuba-3.8.0 test/host.rb
cuba-3.7.0 test/host.rb
cuba-3.6.0 test/host.rb
cuba-3.5.0 test/host.rb
cuba-3.4.0 test/host.rb
cuba-3.3.0 test/host.rb
cuba-3.2.0 test/host.rb
cuba-3.1.1 test/host.rb
cuba-3.1.0 test/host.rb
cuba-3.1.0.rc2 test/host.rb
cuba-3.1.0.rc1 test/host.rb
cuba-3.0.1.rc2 test/host.rb