go: warn about no-op stage_deps calls
Closes Homebrew/homebrew#49389. Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
This commit is contained in:
parent
6a1a57423b
commit
bb37aa2824
@ -7,6 +7,7 @@ module Language
|
|||||||
# The resource names should be the import name of the package,
|
# The resource names should be the import name of the package,
|
||||||
# e.g. `resource "github.com/foo/bar"`
|
# e.g. `resource "github.com/foo/bar"`
|
||||||
def self.stage_deps(resources, target)
|
def self.stage_deps(resources, target)
|
||||||
|
opoo "tried to stage empty resources array" if resources.empty?
|
||||||
resources.grep(Resource::Go) { |resource| resource.stage(target) }
|
resources.grep(Resource::Go) { |resource| resource.stage(target) }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
13
Library/Homebrew/test/test_language_go.rb
Normal file
13
Library/Homebrew/test/test_language_go.rb
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# -*- coding: UTF-8 -*-
|
||||||
|
|
||||||
|
require "testing_env"
|
||||||
|
require "language/go"
|
||||||
|
|
||||||
|
class LanguageGoTests < Homebrew::TestCase
|
||||||
|
def test_stage_deps_empty
|
||||||
|
Language::Go.expects(:opoo).once
|
||||||
|
mktmpdir do |path|
|
||||||
|
shutup { Language::Go.stage_deps [], path }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
x
Reference in New Issue
Block a user