File: runner.rb

package info (click to toggle)
ruby-http 1.0.2-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 520 kB
  • ctags: 322
  • sloc: ruby: 3,934; makefile: 8
file content (17 lines) | stat: -rw-r--r-- 256 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
module ServerRunner
  def run_server(name, &block)
    let! name do
      server = block.call

      Thread.new { server.start }

      server
    end

    after do
      send(name).shutdown
    end
  end
end

RSpec.configure { |c| c.extend ServerRunner }