add spec helper with creds

This commit is contained in:
Tim Lawrence 2016-03-15 15:46:00 +00:00
parent a342fe7971
commit 2c14642035
3 changed files with 21 additions and 4 deletions

View File

@ -1,3 +1,4 @@
require './spec/vcloud_director/spec_helper.rb'
require 'minitest/autorun'
require 'nokogiri'
require './lib/fog/vcloud_director/generators/compute/instantiate_vapp_template_params.rb'
@ -61,9 +62,7 @@ describe Fog::Generators::Compute::VcloudDirector::InstantiateVappTemplateParams
it "Allows New VM Parameters" do
nodes = xml.xpath('//xmlns:VmGeneralParams')
nodes.length.must_equal 2
puts nodes
nodes.length.must_equal 2
end
end

View File

@ -1,8 +1,13 @@
require './spec/vcloud_director/spec_helper.rb'
require 'minitest/autorun'
require './lib/fog/vcloud_director/requests/compute/instantiate_vapp_template.rb'
describe Fog::Compute::VcloudDirector::Real do
before do
Fog.unmock!
end
let(:xml) do
service = Fog::Compute::VcloudDirector.new()
@ -57,7 +62,9 @@ describe Fog::Compute::VcloudDirector::Real do
end
after do
Fog.mock!
end
end

View File

@ -0,0 +1,11 @@
if ENV["FOG_MOCK"] == "true"
Fog.mock!
end
if Fog.mock?
Fog.credentials = {
:vcloud_director_host => 'vcloud-director-host',
:vcloud_director_password => 'vcloud_director_password',
:vcloud_director_username => 'vcd_user@vcd_org_name',
}.merge(Fog.credentials)
end