From 7dc0e4340ed6b2d4100d5f9b135c7c7fd697230d Mon Sep 17 00:00:00 2001 From: Ben Dean Date: Fri, 11 Jul 2014 17:08:07 -0400 Subject: [PATCH] adding failing tests for fixnum args in an array. The args need to be strings so that an error won't happen with `text.gsub` in https://github.com/mitchellh/vagrant/blob/bb052366f7f9616666299a97edcceadae007394a/plugins/provisioners/shell/provisioner.rb#L122 See my comments on mitchellh/vagrant#2982 as to why it needs to test for this. --- .../plugins/provisioners/shell/config_test.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/unit/plugins/provisioners/shell/config_test.rb b/test/unit/plugins/provisioners/shell/config_test.rb index 9827e66e8..946b4c2a8 100644 --- a/test/unit/plugins/provisioners/shell/config_test.rb +++ b/test/unit/plugins/provisioners/shell/config_test.rb @@ -86,4 +86,22 @@ describe "VagrantPlugins::Shell::Config" do ]) end end + + describe 'finalize!' do + it 'changes fixnum args into strings' do + subject.path = file_that_exists + subject.args = 1 + subject.finalize! + + expect(subject.args).to eq '1' + end + + it 'changes fixnum args in arrays into strings' do + subject.path = file_that_exists + subject.args = ["string", 1, 2] + subject.finalize! + + expect(subject.args).to eq ["string", '1', '2'] + end + end end