Sha256: 9756b2118de6c760ab8ca82cd1bf0a4f717c0c8237ed28193a2bfc71c340207e

Contents?: true

Size: 543 Bytes

Versions: 1

Compression:

Stored size: 543 Bytes

Contents

# frozen_string_literal: true

require_relative "helper"

class DefaultHeadersTest < Minitest::Test
  def setup
    @app = Class.new(Tynn)
  end

  def test_set_and_get_headers
    @app.set(:default_headers, "Content-Type" => "text/plain")

    assert_equal "text/plain", @app.default_headers["Content-Type"]
  end

  def test_respond_with_headers
    @app.set(:default_headers, "Content-Type" => "text/plain")

    @app.define {}

    ts = Tynn::Test.new(@app)
    ts.get("/")

    assert_equal @app.default_headers, ts.res.headers
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tynn-2.0.0.alpha test/default_headers_test.rb