Skip to content

Commit

Permalink
test-kitchen#171 support openstack provider in customize; added test
Browse files Browse the repository at this point in the history
  • Loading branch information
xmik committed May 29, 2015
1 parent 0feadb9 commit df35ee7
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
22 changes: 22 additions & 0 deletions spec/kitchen/driver/vagrant_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1365,6 +1365,28 @@
RUBY
end
end

context "for openstack provider" do

before { config[:provider] = "openstack" }

it "adds a line for each element in :customize" do
config[:customize] = {
:key1 => "some string value",
:key2 => 22,
:key3 => false
}
cmd

expect(vagrantfile).to match(regexify(<<-RUBY.gsub(/^ {8}/, "").chomp))
c.vm.provider :openstack do |p|
p.key1 = "some string value"
p.key2 = 22
p.key3 = false
end
RUBY
end
end
end

def debug_lines
Expand Down
2 changes: 1 addition & 1 deletion templates/Vagrantfile.erb
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ Vagrant.configure("2") do |c|
<% else %>
p.vmx["<%= key %>"] = "<%= value %>"
<% end %>
<% else # other vagrant provider %>
<% when "openstack" %>
<% if value.is_a? String %>
p.<%= key %> = "<%= value%>"
<% else %>
Expand Down

0 comments on commit df35ee7

Please sign in to comment.