incubator-deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lut...@apache.org
Subject svn commit: r962259 - /incubator/deltacloud/trunk/server/features/support/env.rb
Date Thu, 08 Jul 2010 23:41:30 GMT
Author: lutter
Date: Thu Jul  8 23:41:30 2010
New Revision: 962259

URL: http://svn.apache.org/viewvc?rev=962259&view=rev
Log:
Cucumber tests fixed for Ruby 1.8.6

Modified:
    incubator/deltacloud/trunk/server/features/support/env.rb

Modified: incubator/deltacloud/trunk/server/features/support/env.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/features/support/env.rb?rev=962259&r1=962258&r2=962259&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/features/support/env.rb (original)
+++ incubator/deltacloud/trunk/server/features/support/env.rb Thu Jul  8 23:41:30 2010
@@ -1,22 +1,25 @@
 require 'sinatra'
 require 'server'
 require 'rack/test'
-require 'base64'
+
+SERVER_DIR = File::expand_path(File::join(File::dirname(__FILE__), "../.."))
 
 Sinatra::Application.set :environment, :test
+Sinatra::Application.set :root, SERVER_DIR
 
 CONFIG = {}
-load 'features/support/configuration_mock.rb'
+load "features/support/configuration_mock.rb"
 
 World do
   def app
     @app = Rack::Builder.new do
+      ENV['API_DRIVER'] = "mock"
       run Sinatra::Application
     end
   end
 
   def replace_variables(str)
-    CONFIG[$DRIVER].each_key.collect { |k| str.gsub!(/\<#{k.to_s.upcase}\>/, "#{CONFIG[$DRIVER][k]}")
}
+    CONFIG[$DRIVER].keys.collect { |k| str.gsub!(/\<#{k.to_s.upcase}\>/, "#{CONFIG[$DRIVER][k]}")
}
     return str
   end
 



Mime
View raw message