From d14f5dae7eaedc48ca1048c169f54a7cbce5b021 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Mon, 30 Jul 2018 16:59:51 +0200 Subject: [PATCH] Add spec for SVN directory name containing `@`. --- .../test/unpack_strategy/subversion_spec.rb | 32 +++++++++++-------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/Library/Homebrew/test/unpack_strategy/subversion_spec.rb b/Library/Homebrew/test/unpack_strategy/subversion_spec.rb index 002899556d..b56b521caa 100644 --- a/Library/Homebrew/test/unpack_strategy/subversion_spec.rb +++ b/Library/Homebrew/test/unpack_strategy/subversion_spec.rb @@ -1,22 +1,26 @@ require_relative "shared_examples" describe UnpackStrategy::Subversion do - let(:repo) { - mktmpdir.tap do |repo| - system "svnadmin", "create", repo - end - } - let(:working_copy) { - mktmpdir.tap do |working_copy| - system "svn", "checkout", "file://#{repo}", working_copy - - FileUtils.touch working_copy/"test" - system "svn", "add", working_copy/"test" - system "svn", "commit", working_copy, "-m", "Add `test` file." - end - } + let(:repo) { mktmpdir } + let(:working_copy) { mktmpdir } let(:path) { working_copy } + before(:each) do + system "svnadmin", "create", repo + + system "svn", "checkout", "file://#{repo}", working_copy + + FileUtils.touch working_copy/"test" + system "svn", "add", working_copy/"test" + system "svn", "commit", working_copy, "-m", "Add `test` file." + end + include_examples "UnpackStrategy::detect" include_examples "#extract", children: ["test"] + + context "when the directory name contains an '@' symbol" do + let(:working_copy) { mktmpdir(["", "@1.2.3"]) } + + include_examples "#extract", children: ["test"] + end end