Sha256: 9b21a83366db8b623d759706c6c6b907eb217a325b56b94b3d273ffc44a3ae60
Contents?: true
Size: 784 Bytes
Versions: 46
Compression:
Stored size: 784 Bytes
Contents
shared_context 'mock ssh' do let(:ssh_mock_outfile) { Tempfile.new('tunnel_spec') } after do ssh_mock_outfile.close ssh_mock_outfile.unlink end around do |example| mocks_path = File.expand_path('../../mock', __FILE__) env = { PATH: "#{mocks_path}#{File::PATH_SEPARATOR}#{ENV['PATH']}", SSH_MOCK_OUTFILE: ssh_mock_outfile.path } ClimateControl.modify(env) { example.run } end def read_mock_pid File.open(ssh_mock_outfile) do |f| return JSON.load(f.read).fetch('pid') end end def read_mock_argv File.open(ssh_mock_outfile) do |f| return JSON.load(f.read).fetch('argv') end end def read_mock_env File.open(ssh_mock_outfile) do |f| return JSON.load(f.read).fetch('env') end end end
Version data entries
46 entries across 46 versions & 1 rubygems