Skip to content

Commit

Permalink
Add failing test when not using binmode in Windows
Browse files Browse the repository at this point in the history
Signed-off-by: Ken MacLeod <ken.macleod@csgi.com>
  • Loading branch information
kenmacleod-csg committed Jan 12, 2019
1 parent 8a20097 commit da095f9
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
Binary file added spec/fixtures/fixture_binary
Binary file not shown.
3 changes: 2 additions & 1 deletion spec/mixlib/lib_archive_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
describe "#create" do
let(:test_root) { Dir.mktmpdir(nil) }
let(:archive_path) { File.join(test_root, "test.tar.gz") }
let(:file_paths) { %w{ . .. fixture_a fixture_b fixture_c } }
let(:file_paths) { %w{ . .. fixture_a fixture_b fixture_c fixture_binary } }

context "using the correct options" do
it "requests the correct tar format" do
Expand All @@ -51,6 +51,7 @@
target = File.join(test_root, "target")
Mixlib::Archive::LibArchive.new(archive_path).extract(target)
expect(Dir.entries(target)).to match_array file_paths
expect(File.size("#{target}/fixture_binary")).to eql 6
end

end
Expand Down
3 changes: 2 additions & 1 deletion spec/mixlib/tar_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
describe "#create" do
let(:test_root) { Dir.mktmpdir(nil) }
let(:archive_path) { File.join(test_root, "test.tar.gz") }
let(:file_paths) { %w{ . .. fixture_a fixture_b fixture_c } }
let(:file_paths) { %w{ . .. fixture_a fixture_b fixture_c fixture_binary } }

it "creates a tarball" do
Dir.chdir(fixtures_path) do
Expand All @@ -71,6 +71,7 @@
target = File.join(test_root, "target")
Mixlib::Archive::LibArchive.new(archive_path).extract(target, ignore: %w{ . .. })
expect(Dir.entries(target)).to match_array file_paths
expect(File.size("#{target}/fixture_binary")).to eql 6
end

end
Expand Down
1 change: 1 addition & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
require "mixlib/archive"
require "mixlib/archive/tar"
require "mixlib/archive/lib_archive"
require "pathname"

module Fixtures
def fixtures_path
Expand Down

0 comments on commit da095f9

Please sign in to comment.