yahns.git  about / heads / tags
sleepy, multi-threaded, non-blocking application server for Ruby
blob 3f7a26107f22abe1ba22f55300ce5858b75e7ba4 901 bytes (raw)
$ git show v0.0.1:test/test_rack.rb	# shows this blob on the CLI

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
 
# Copyright (C) 2013, Eric Wong <normalperson@yhbt.net> and all contributors
# License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
require_relative 'helper'
require 'rack/lobster'
require 'yahns/rack'
class TestRack < Testcase
  parallelize_me!

  def test_rack
    tmp = tmpfile(%W(config .ru))
    tmp.write "run Rack::Lobster.new\n"
    rapp = GTL.synchronize { Yahns::Rack.new(tmp.path) }
    assert_kind_of Rack::Lobster, GTL.synchronize { rapp.app_after_fork }
    defaults = rapp.app_defaults
    assert_kind_of Hash, defaults
    tmp.close!
  end

  def test_rack_preload
    tmp = tmpfile(%W(config .ru))
    tmp.write "run Rack::Lobster.new\n"
    rapp = GTL.synchronize { Yahns::Rack.new(tmp.path, preload: true) }
    assert_kind_of Rack::Lobster, rapp.instance_variable_get(:@app)
    defaults = rapp.app_defaults
    assert_kind_of Hash, defaults
    tmp.close!
  end
end

git clone git://yhbt.net/yahns.git
git clone https://yhbt.net/yahns.git