On Tue, 2010-03-16 at 15:48 +0100, [email protected] wrote:
> First one allowing "require 'deltacloud'" in 'server' directory,
> which could be usefull for testing in some cases.
>
> Second one removes 'rcov' from 'features' cucumber task and create new one
> called 'rcov'. So for code coverage reports you can call 'rake rcov'
These two additions are fine, though the underlying cucmber tests still
fail for me.
I looked a little more into this; it seems the issues I am having are
* There was a small typo in env.rb
* The server started with a root directory somewhere inside the
polyglot gem's install dir, and could therefore not find its
views
* The server responds with HTML, even though the Accept header is
set to application/xml (that works with a non-test server)
Attached is a small patch for the first two issues; haven't been able to
track down why the server responds with HTML.
David
>From b33fc41c99b068b86895ca4af75bf8aaf1f1421e Mon Sep 17 00:00:00 2001
From: David Lutterkort <[email protected]>
Date: Tue, 16 Mar 2010 15:28:09 -0700
Subject: [PATCH core] Small test fixes
---
server/features/support/env.rb | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/server/features/support/env.rb b/server/features/support/env.rb
index 5539ade..80e9329 100644
--- a/server/features/support/env.rb
+++ b/server/features/support/env.rb
@@ -3,23 +3,27 @@ require 'server'
require 'rack/test'
require 'base64'
+SERVER_DIR = File::expand_path(File::join(File::dirname(__FILE__), "../.."))
+
Sinatra::Application.set :environment, :test
+# Somehow, polyglot sets this wrong
+Sinatra::Application.set :root, SERVER_DIR
CONFIG = {}
load 'features/support/configuration_mock.rb'
World do
def app
+ ENV['API_DRIVER'] = "mock"
@app = Rack::Builder.new do
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
include Rack::Test::Methods
end
-
--
1.6.6.1
_______________________________________________
deltacloud-devel mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/deltacloud-devel