aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMike McQuaid2017-08-12 15:01:16 +0100
committerGitHub2017-08-12 15:01:16 +0100
commite1bab7ede9461a6d5c93fb7240ba5a1f3bf7a7fb (patch)
tree702e932fa60b4af6c174e4f061e77184dfeead6d /Library
parentb93f1e356990c4e7a12517edb479ddeab9b27978 (diff)
parentae8235c555d6bdcbce140e26343a12da95cf46fc (diff)
downloadbrew-e1bab7ede9461a6d5c93fb7240ba5a1f3bf7a7fb.tar.bz2
Merge pull request #3050 from Homebrew/revert-3046-double_formula_load_error
Revert "Raise an exception when double loading a formula"
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/formulary.rb2
-rw-r--r--Library/Homebrew/test/formulary_spec.rb10
2 files changed, 0 insertions, 12 deletions
diff --git a/Library/Homebrew/formulary.rb b/Library/Homebrew/formulary.rb
index b26846e00..dd67b4f24 100644
--- a/Library/Homebrew/formulary.rb
+++ b/Library/Homebrew/formulary.rb
@@ -20,8 +20,6 @@ module Formulary
raise "Formula loading disabled by HOMEBREW_DISABLE_LOAD_FORMULA!"
end
- raise "Formula #{name} has already been loaded" if const_defined?(namespace)
-
mod = Module.new
const_set(namespace, mod)
begin
diff --git a/Library/Homebrew/test/formulary_spec.rb b/Library/Homebrew/test/formulary_spec.rb
index 7a7c8811a..234ebc93c 100644
--- a/Library/Homebrew/test/formulary_spec.rb
+++ b/Library/Homebrew/test/formulary_spec.rb
@@ -27,16 +27,6 @@ describe Formulary do
let(:bottle_dir) { Pathname.new("#{TEST_FIXTURE_DIR}/bottles") }
let(:bottle) { bottle_dir/"testball_bottle-0.1.#{Utils::Bottles.tag}.bottle.tar.gz" }
- describe "::load_formula" do
- it "does not allow namespace repetition" do |example|
- definition = "Foo = Class.new(Formula)"
- namespace = "Test#{example.description.hash.abs}"
- subject.load_formula("foo", "bar", definition, namespace)
- expect { subject.load_formula("foo", "bar", definition, namespace) }
- .to raise_error RuntimeError, /already.* loaded/
- end
- end
-
describe "::class_s" do
it "replaces '+' with 'x'" do
expect(subject.class_s("foo++")).to eq("Fooxx")