diff options
| author | Gautham Goli | 2017-05-14 13:49:42 +0530 | 
|---|---|---|
| committer | Gautham Goli | 2017-05-14 22:05:46 +0530 | 
| commit | 91efcb045e687301a8440d91e55ddbc1c053b757 (patch) | |
| tree | d507b53ea78c6bbe6defdeb8395a8494360c0b59 /Library/Homebrew/test/dev-cmd | |
| parent | 459fef3b09b25d3e24cce6aa6f2e3a7bd5460a2b (diff) | |
| download | brew-91efcb045e687301a8440d91e55ddbc1c053b757.tar.bz2 | |
Port audit_homepage method to rubocop and add tests
Diffstat (limited to 'Library/Homebrew/test/dev-cmd')
| -rw-r--r-- | Library/Homebrew/test/dev-cmd/audit_spec.rb | 74 | 
1 files changed, 0 insertions, 74 deletions
diff --git a/Library/Homebrew/test/dev-cmd/audit_spec.rb b/Library/Homebrew/test/dev-cmd/audit_spec.rb index c914a9a20..b07ffaadc 100644 --- a/Library/Homebrew/test/dev-cmd/audit_spec.rb +++ b/Library/Homebrew/test/dev-cmd/audit_spec.rb @@ -385,80 +385,6 @@ describe FormulaAuditor do      end    end -  describe "#audit_homepage" do -    specify "homepage URLs" do -      fa = formula_auditor "foo", <<-EOS.undent, online: true -        class Foo < Formula -          homepage "ftp://example.com/foo" -          url "http://example.com/foo-1.0.tgz" -        end -      EOS - -      fa.audit_homepage -      expect(fa.problems) -        .to eq(["The homepage should start with http or https (URL is #{fa.formula.homepage})."]) - -      formula_homepages = { -        "bar" => "http://www.freedesktop.org/wiki/bar", -        "baz" => "http://www.freedesktop.org/wiki/Software/baz", -        "qux" => "https://code.google.com/p/qux", -        "quux" => "http://github.com/quux", -        "corge" => "http://savannah.nongnu.org/corge", -        "grault" => "http://grault.github.io/", -        "garply" => "http://www.gnome.org/garply", -        "sf1" => "http://foo.sourceforge.net/", -        "sf2" => "http://foo.sourceforge.net", -        "sf3" => "http://foo.sf.net/", -        "sf4" => "http://foo.sourceforge.io/", -        "waldo" => "http://www.gnu.org/waldo", -      } - -      formula_homepages.each do |name, homepage| -        fa = formula_auditor name, <<-EOS.undent -          class #{Formulary.class_s(name)} < Formula -            homepage "#{homepage}" -            url "http://example.com/#{name}-1.0.tgz" -          end -        EOS - -        fa.audit_homepage -        if homepage =~ %r{http:\/\/www\.freedesktop\.org} -          if homepage =~ /Software/ -            expect(fa.problems.first).to match( -              "#{homepage} should be styled " \ -              "`https://wiki.freedesktop.org/www/Software/project_name`", -            ) -          else -            expect(fa.problems.first).to match( -              "#{homepage} should be styled " \ -              "`https://wiki.freedesktop.org/project_name`", -            ) -          end -        elsif homepage =~ %r{https:\/\/code\.google\.com} -          expect(fa.problems.first) -            .to match("#{homepage} should end with a slash") -        elsif homepage =~ /foo\.(sf|sourceforge)\.net/ -          expect(fa.problems.first) -            .to match("#{homepage} should be `https://foo.sourceforge.io/`") -        else -          expect(fa.problems.first) -            .to match("Please use https:// for #{homepage}") -        end -      end -    end - -    specify "missing homepage" do -      fa = formula_auditor "foo", <<-EOS.undent, online: true -        class Foo < Formula -          url "http://example.com/foo-1.0.tgz" -        end -      EOS - -      fa.audit_homepage -      expect(fa.problems.first).to match("Formula should have a homepage.") -    end -  end -    describe "#audit_text" do      specify "xcodebuild suggests symroot" do        fa = formula_auditor "foo", <<-EOS.undent  | 
