brew/Library/Homebrew/test/livecheck/strategy/sourceforge_spec.rb
nandahkrishna f520301180
livecheck migration: add strategies
Co-authored-by: Sam Ford <1584702+samford@users.noreply.github.com>
Co-authored-by: Thierry Moisan <thierry.moisan@gmail.com>
Co-authored-by: Dawid Dziurla <dawidd0811@gmail.com>
Co-authored-by: Maxim Belkin <maxim.belkin@gmail.com>
Co-authored-by: Issy Long <me@issyl0.co.uk>
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
Co-authored-by: Seeker <meaningseeking@protonmail.com>
2020-08-27 20:00:30 +05:30

21 lines
648 B
Ruby

# frozen_string_literal: true
require "livecheck/strategy/sourceforge"
describe Homebrew::Livecheck::Strategy::Sourceforge do
subject(:sourceforge) { described_class }
let(:sourceforge_url) { "https://downloads.sourceforge.net/project/abc/def-1.2.3.tar.gz" }
let(:non_sourceforge_url) { "https://brew.sh/test" }
describe "::match?" do
it "returns true if the argument provided is a SourceForge URL" do
expect(sourceforge.match?(sourceforge_url)).to be true
end
it "returns false if the argument provided is not a SourceForge URL" do
expect(sourceforge.match?(non_sourceforge_url)).to be false
end
end
end