1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61285 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
eregon 2017-12-15 17:44:37 +00:00
parent f941bdf263
commit 30ed82e772
39 changed files with 1078 additions and 105 deletions

View file

@ -425,6 +425,28 @@ describe "Constant resolution within a singleton class (class << obj)" do
end
end
describe "top-level constant lookup" do
context "on a class" do
ruby_version_is "" ... "2.5" do
it "searches Object successfully after searching other scopes" do
->() {
String::Hash.should == Hash
}.should complain(/toplevel constant Hash referenced by/)
end
end
ruby_version_is "2.5" do
it "does not search Object after searching other scopes" do
->() { String::Hash }.should raise_error(NameError)
end
end
end
it "searches Object unsuccessfully when searches on a module" do
->() { Enumerable::Hash }.should raise_error(NameError)
end
end
describe "Module#private_constant marked constants" do
it "remain private even when updated" do