diff options
author | rautenberg <rautenberg@in-silico.ch> | 2012-04-13 13:51:31 +0200 |
---|---|---|
committer | rautenberg <rautenberg@in-silico.ch> | 2012-04-13 13:51:31 +0200 |
commit | ee76d660c9c4b6fcb93b903117d8590cc5443312 (patch) | |
tree | 49763645e5117d1656503c5738363d7462783ba6 /test/setup.rb | |
parent | 61e8f17c12f1560f81fa5cdc0d7ddb05d16f70cc (diff) |
change fixed variables to globals in test.rb configuration file
Diffstat (limited to 'test/setup.rb')
-rw-r--r-- | test/setup.rb | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/test/setup.rb b/test/setup.rb index c63a17c..b035a80 100644 --- a/test/setup.rb +++ b/test/setup.rb @@ -4,8 +4,11 @@ Bundler.require require 'opentox-client' require File.join(ENV["HOME"],".opentox","config","test.rb") -if defined? $aa - @@subjectid = OpenTox::Authorization.authenticate($aa[:user], $aa[:password]) -else - @@subjectid = "" +begin + AA = $aa[:uri] + @@subjectid = OpenTox::Authorization.authenticate($aa[:user],$aa[:password]) + raise if !OpenTox::Authorization.is_token_valid(@@subjectid) +rescue + puts "Configuration Error: $aa[:uri], $aa[:user] or $aa[:password] are not defined in: " + File.join(ENV["HOME"],".opentox","config","test.rb") + exit end |