Skip to content
Browse files

Updated loading config

  • Loading branch information...
1 parent 8a1014e commit 60e177df4d1f7f7cdf207a0e149b1a941ba5ffd3 @mrako committed Jul 1, 2014
Showing with 16 additions and 7 deletions.
  1. +16 −7 lib/tasks/robotframework.rake
View
23 lib/tasks/robotframework.rake
@@ -1,12 +1,11 @@
-$port = $config['port'] || 3333
-$report_dir = 'robot/reports'
-$test_dir = 'robot/tests'
+def load_config(path = "config/robot.yml")
+ config_path = "#{Rails.root}/#{path}"
-config_path = "#{Rails.root}/config/robot.yml"
-if File.exists?(config_path)
- File.open(config_path, 'r') do |file|
- $config = YAML::load(file)
+ if File.exists?(config_path)
+ File.open(config_path, 'r') do |file|
+ $config = YAML::load(file)
+ end
end
end
@@ -36,6 +35,16 @@ rescue Timeout::Error
end
+
+load_config()
+
+$report_dir = 'robot/reports'
+$test_dir = 'robot/tests'
+
+$port = $config['port'] || 3333
+
+
+
namespace :robot do
desc "Prepare"
task :prepare do

0 comments on commit 60e177d

Please sign in to comment.
Something went wrong with that request. Please try again.