Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specs for Kernel#load accepting a module #973

Merged
merged 1 commit into from
Oct 31, 2022

Conversation

HeroProtagonist
Copy link
Contributor

relates to #923

Kernel#load now accepts a module as the second argument,
and will load the file using the given module as the
top-level module. [Feature #6210]

Comment on lines 158 to 170
ruby_version_is ""..."3.1" do
it "does not set the enclosing scope to the supplied module" do
path = File.expand_path "wrap_fixture.rb", CODE_LOADING_DIR
mod = Module.new
@object.load(path, mod)

Object.const_defined?(:LoadSpecWrap).should be_false
mod.const_defined?(:LoadSpecWrap).should be_false

wrap_module = ScratchPad.recorded[1]
wrap_module.should be_an_instance_of(Module)
end
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you remove this? It's not really meaningful because before 3.1 the 2nd arg to load is just a boolean.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure!

Copy link
Member

@eregon eregon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@eregon eregon merged commit d203f64 into ruby:master Oct 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants