aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/test')
-rw-r--r--Library/Homebrew/test/test_requirement.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/Library/Homebrew/test/test_requirement.rb b/Library/Homebrew/test/test_requirement.rb
index ed7c37706..682ee432e 100644
--- a/Library/Homebrew/test/test_requirement.rb
+++ b/Library/Homebrew/test/test_requirement.rb
@@ -92,4 +92,12 @@ class RequirementTests < Test::Unit::TestCase
req = Class.new(Requirement) { build true }.new
assert req.build?
end
+
+ def test_infer_name_from_class
+ klass, const = self.class, :FooRequirement
+ klass.const_set(const, Class.new(Requirement))
+ assert_equal "foo", klass.const_get(const).new.name
+ ensure
+ klass.send(:remove_const, const) if klass.const_defined?(const)
+ end
end