-
-
Notifications
You must be signed in to change notification settings - Fork 388
Add specs for Module.used_refinements
#1028
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
Add specs for Module.used_refinements
#1028
Conversation
461e1c1
to
67a6aaa
Compare
suggestion: There are the following additional cases that I would consider:
|
67a6aaa
to
75d4a14
Compare
Could You please provide an example of second suggestion? |
Do you mean an example of usage of # language/next_spec.rb
ScratchPad.record []
[1].each do |i|
begin
ScratchPad << :begin
next
ensure
ScratchPad << :ensure
end
end
ScratchPad.recorded.should == [:begin, :ensure] |
I was thinking about this |
I meant the following case: # it ignores refinements imported in a module that is included into the current one
m1 = Module.new do
refine Integer do
end
end
m2 = Module.new do
using m1
end
Module.new do
include m2
p Module.used_refinements # => I would expect `[]`
end There is another case that may be worth to check - when some refinements are declared in a module, that is included in a module that is passed as argument for # it returns refinements even not defined directly in a module refinements are imported from
m1 = Module.new do
refine Integer do
end
end
m2 = Module.new do
include m1
end
Module.new do
using m2
p Module.used_refinements # => [#<refinement:Integer@#<Module:0x000000010391f3d0>>]
end |
75d4a14
to
a5ae679
Compare
Thank you for the specs! |
#1016
[Feature #14332]