Sha256: 467373c81e968cf142f2fddaf1a53972756f030412e281adaeb069ca40f0ee7f

Contents?: true

Size: 523 Bytes

Versions: 12

Compression:

Stored size: 523 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_equal ["worked"], resp.body
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_equal ["worked"], resp.body
end

Version data entries

12 entries across 12 versions & 1 rubygems

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