Sha256: 83602acb869fddf6ae904744d95bc15ab1f4841d2ac27629737bbbfff017acb8
Contents?: true
Size: 811 Bytes
Versions: 8
Compression:
Stored size: 811 Bytes
Contents
# Set test port so there's nothing colliding Landrush::Server.port = 111_53 module SilenceOutput def self.silence orig_out = $stdout orig_err = $stderr $stdout = StringIO.new $stderr = StringIO.new yield ensure $stdout = orig_out $stderr = orig_err end def self.included(base) orig_stop_method = base.method(:stop) base.define_singleton_method :stop do SilenceOutput.silence {orig_stop_method.call} end end end module Landrush class Server include SilenceOutput end end module TestServerHooks def teardown super # Cleanup any stray server instances from tests if Landrush::Server.running? Landrush::Server.stop end Landrush::Store.reset end end module MiniTest class Spec include TestServerHooks end end
Version data entries
8 entries across 8 versions & 1 rubygems