aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test/download_strategies_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/test/download_strategies_spec.rb')
-rw-r--r--Library/Homebrew/test/download_strategies_spec.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/Library/Homebrew/test/download_strategies_spec.rb b/Library/Homebrew/test/download_strategies_spec.rb
index 06d6fa855..7ad070fc4 100644
--- a/Library/Homebrew/test/download_strategies_spec.rb
+++ b/Library/Homebrew/test/download_strategies_spec.rb
@@ -209,6 +209,19 @@ describe CurlDownloadStrategy do
it "parses the opts and sets the corresponding args" do
expect(subject.send(:_curl_opts)).to eq(["--user", "download:123456"])
end
+
+ describe "#tarball_path" do
+ subject { described_class.new(name, resource).tarball_path }
+
+ context "when URL ends with file" do
+ it { is_expected.to eq(HOMEBREW_CACHE/"foo-.tar.gz") }
+ end
+
+ context "when URL file is in middle" do
+ let(:url) { "http://example.com/foo.tar.gz/from/this/mirror" }
+ it { is_expected.to eq(HOMEBREW_CACHE/"foo-.tar.gz") }
+ end
+ end
end
describe DownloadStrategyDetector do