File: helper.rb

package info (click to toggle)
ruby-sshkit 1.25.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 712 kB
  • sloc: ruby: 3,749; makefile: 2
file content (40 lines) | stat: -rw-r--r-- 896 bytes parent folder | download
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
29
30
31
32
33
34
35
36
37
38
39
40
require 'tempfile'
require 'minitest/autorun'
require 'minitest/reporters'
require 'mocha/minitest'
require 'json'

$LOAD_PATH.unshift(File.dirname(__FILE__))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'sshkit'

Dir[File.expand_path('test/support/*.rb')].each { |file| require file }

class UnitTest < Minitest::Test

  def setup
    SSHKit.reset_configuration!
  end

  SSHKit::Backend::ConnectionPool.class_eval do
    alias_method :old_flush_connections, :flush_connections
    def flush_connections
      Thread.current[:sshkit_pool] = {}
    end
  end
end

class FunctionalTest < Minitest::Test
  def setup
    require_relative "support/docker_wrapper"
    return if DockerWrapper.running?

    DockerWrapper.start
    DockerWrapper.wait_for_ssh_server
  end
end

#
# Force colours in Autotest
#
Minitest::Reporters.use! Minitest::Reporters::SpecReporter.new