Sha256: e0222d165578d48dfcb7d60ea73e1e6c4d86db8abc6a1aa3e46148949e4bf989

Contents?: true

Size: 862 Bytes

Versions: 1

Compression:

Stored size: 862 Bytes

Contents

require File.dirname(__FILE__) + '/test_helper'

class TransferTest < Test::Unit::TestCase
  def setup
    @path = "/tmp/astrovan.#{Time.now.to_i}"
    super
  end

  def teardown
    system "rm -rf #{@path}.from #{@path}.to"
    super
  end

  def test_should_put_data_into_file
    data = Time.now.utc.to_s
    to = "#{@path}.to"
    using 'astrovan.local', :password => ENV['PASSWORD'], :data => data, :to => to do
      put data, :to => to
    end
    assert_equal data, File.open(to) { |f| f.gets.chomp }
  end

  def test_should_upload_file
    data = Time.now.utc.to_s
    from = "#{@path}.from"
    to = "#{@path}.to"
    File.open(from, "w") { |f| f.puts data }
    using 'astrovan.local', :password => ENV['PASSWORD'], :from => from, :to => to do
      upload from, :to => to
    end
    assert_equal data, File.open(to) { |f| f.gets.chomp }
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sbfaulkner-astrovan-0.5.8 test/transfer_test.rb