You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by mf...@apache.org on 2012/01/23 14:53:38 UTC
svn commit: r1234795 - /deltacloud/trunk/tests/mock/support/env.rb
Author: mfojtik
Date: Mon Jan 23 13:53:38 2012
New Revision: 1234795
URL: http://svn.apache.org/viewvc?rev=1234795&view=rev
Log:
Mock: Removed unnecessary code in Cucumber environment file
Signed-off-by: Michal fojtik <mf...@redhat.com>
Modified:
deltacloud/trunk/tests/mock/support/env.rb
Modified: deltacloud/trunk/tests/mock/support/env.rb
URL: http://svn.apache.org/viewvc/deltacloud/trunk/tests/mock/support/env.rb?rev=1234795&r1=1234794&r2=1234795&view=diff
==============================================================================
--- deltacloud/trunk/tests/mock/support/env.rb (original)
+++ deltacloud/trunk/tests/mock/support/env.rb Mon Jan 23 13:53:38 2012
@@ -1,48 +1,26 @@
-SERVER_DIR = File::expand_path(File::join(File::dirname(__FILE__), "../../../server"))
+require 'rubygems'
+require 'nokogiri'
+SERVER_DIR = File::expand_path(File::join(File::dirname(__FILE__), "../../../server"))
$top_srcdir = SERVER_DIR
$:.unshift File::join($top_srcdir, 'lib')
+Dir.chdir(SERVER_DIR)
ENV['API_DRIVER'] = 'mock'
+ENV.delete('API_VERBOSE')
+load File.join($top_srcdir, 'lib', 'deltacloud', 'server.rb')
-Dir.chdir(SERVER_DIR)
-require 'rubygems'
-require 'nokogiri'
-require 'deltacloud/server'
require 'rack/test'
-Sinatra::Application.set :environment, :test
-Sinatra::Application.set :root, SERVER_DIR
-
CONFIG = {
:username => 'mockuser',
:password => 'mockpassword'
}
-ENV['RACK_ENV'] = 'test'
-
-World do
-
- include Rack::Test::Methods
-
- def app
- @app = Rack::Builder.new do
- set :environment => :test
- set :loggining => true
- set :raise_errors => true
- set :show_exceptions => true
- run Sinatra::Application
- end
- end
-
- def output_xml
- Nokogiri::XML(last_response.body)
- end
-
- Before do
- unless @no_header
- header 'Accept', 'application/xml'
- end
- end
+def output_xml
+ Nokogiri::XML(last_response.body)
+end
+def app
+ Sinatra::Application
end