spec/spec_helper.rb in wagon-0.9.5 vs spec/spec_helper.rb in wagon-0.10.0
- old
+ new
@@ -11,10 +11,11 @@
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))
@@ -24,9 +25,14 @@
$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|