diff options
author | Bryan McLellan <btm@chef.io> | 2019-06-04 00:46:32 -0400 |
---|---|---|
committer | Bryan McLellan <btm@chef.io> | 2019-06-04 00:46:32 -0400 |
commit | 06662be51728188d982abe57fdcab35593fe4e9b (patch) | |
tree | b07621463768be0f37db2ac6ef9b50a5e811a769 /spec | |
parent | 8ab574c75ada5112b89149cc63b3a4f007664974 (diff) | |
download | chef-06662be51728188d982abe57fdcab35593fe4e9b.tar.gz |
Create bootstrap template in binmode to fix line endings
Tempfile will create a file with CRLF on Windows, which when we upload to a
linux system then cannot be executed because of the line endings. Setting to
binmode prevents this.
Fixes chef/knife-ec2#580
Signed-off-by: Bryan McLellan <btm@chef.io>
Diffstat (limited to 'spec')
-rw-r--r-- | spec/unit/knife/bootstrap/train_connector_spec.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/spec/unit/knife/bootstrap/train_connector_spec.rb b/spec/unit/knife/bootstrap/train_connector_spec.rb index 385a192648..c3c559c65b 100644 --- a/spec/unit/knife/bootstrap/train_connector_spec.rb +++ b/spec/unit/knife/bootstrap/train_connector_spec.rb @@ -171,6 +171,7 @@ describe Chef::Knife::Bootstrap::TrainConnector do expect(File.read(local_path)).to eq "test data" expect(remote_path).to eq "/target/path" end + expect_any_instance_of(Tempfile).to receive(:binmode) subject.upload_file_content!("test data", "/target/path") end end |