Sha256: 1f495e033f01870a84039d02ba7beddd0a603a661f9d9887d4c7db3712cbfa2d
Contents?: true
Size: 918 Bytes
Versions: 12
Compression:
Stored size: 918 Bytes
Contents
BASE_PATH = File.join(File.dirname(__FILE__), '..') USER_FILE = File.join(BASE_PATH, 'spec', 'user.dat') $LOAD_PATH.unshift(File.dirname(__FILE__)) $LOAD_PATH.unshift(File.join(BASE_PATH, 'lib')) require 'spec' require 'spec/autorun' require 'rubygems' require 'wagon' require 'highline/import' $user = nil def establish_connection puts "Create a connection for testing: " username = ask("What is your lds.org username? ") password = ask("What is your lds.org password? ") { |prompt| prompt.echo = "*" } $user = Wagon::connect(username, password) open(USER_FILE, 'w').write(Marshal.dump($user)) end def restore_connection $user = Marshal.restore(open(USER_FILE).read) end if File.exists?(USER_FILE) restore_connection() if $user.expired? puts "Previous connection timed out." establish_connection() end else establish_connection() end Spec::Runner.configure do |config| end
Version data entries
12 entries across 12 versions & 1 rubygems