Sha256: ae69eb763fffc22f95dfdf00faf758d212a3fe39baeafa17141ac4d497f40efb

Contents?: true

Size: 674 Bytes

Versions: 1

Compression:

Stored size: 674 Bytes

Contents

require 'spec_helper'

def account_file_path
  File.join(File.dirname(__FILE__), "account.yaml")
end

def account?
  account
end

def account
  if ENV["MEGA_EMAIL"] and ENV["MEGA_PASSWORD"]
    {'email' => ENV["MEGA_EMAIL"], 'password' => ENV["MEGA_PASSWORD"]}
  elsif File.exist?(account_file_path)
    YAML.load_file(account_file_path)
  else
    nil
  end
end

def login
  Rmega.login(account['email'], account['password'])
end

def temp_folder
  $temp_folder ||= "#{Dir.tmpdir}/#{SecureRandom.hex(10)}"
end

RSpec.configure do |config|
  config.before(:all) do
    FileUtils.mkdir_p(temp_folder)
  end

  config.after(:all) do
    FileUtils.rm_rf(temp_folder)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rmega-0.3.2 spec/integration_spec_helper.rb