Return-Path: X-Original-To: apmail-deltacloud-commits-archive@www.apache.org Delivered-To: apmail-deltacloud-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0BAD09936 for ; Mon, 23 Jan 2012 13:54:00 +0000 (UTC) Received: (qmail 5711 invoked by uid 500); 23 Jan 2012 13:54:00 -0000 Delivered-To: apmail-deltacloud-commits-archive@deltacloud.apache.org Received: (qmail 5692 invoked by uid 500); 23 Jan 2012 13:53:59 -0000 Mailing-List: contact commits-help@deltacloud.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@deltacloud.apache.org Delivered-To: mailing list commits@deltacloud.apache.org Received: (qmail 5685 invoked by uid 99); 23 Jan 2012 13:53:59 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Jan 2012 13:53:59 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Jan 2012 13:53:59 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id EBD2F2388AC8 for ; Mon, 23 Jan 2012 13:53:38 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1234795 - /deltacloud/trunk/tests/mock/support/env.rb Date: Mon, 23 Jan 2012 13:53:38 -0000 To: commits@deltacloud.apache.org From: mfojtik@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120123135338.EBD2F2388AC8@eris.apache.org> 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 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