Sha256: 6cc8a133c79700c14d9dc2262d12fd6f358d806b57d0f074bfdd1a7ae8d341bc

Contents?: true

Size: 629 Bytes

Versions: 4

Compression:

Stored size: 629 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.exists?(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
  Dir.tmpdir
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

4 entries across 4 versions & 1 rubygems

Version Path
rmega-0.2.5 spec/integration_spec_helper.rb
rmega-0.2.4 spec/integration_spec_helper.rb
rmega-0.2.2 spec/integration_spec_helper.rb
rmega-0.2.1 spec/integration_spec_helper.rb