Bug #7213
closedNamespace regression problem in RSpec from 1.9.2 to 1.9.3
Description
This article describes a bug which appeared in 1.9.3: "Including namespace module through RSpec config in Ruby 1.9.3":http://stackoverflow.com/questions/13042298/including-namespace-module-through-rspec-config-in-ruby-1-9-3
Some people believe that it could be related to #3422 which seemed to introduce regression but it wasn't sure if this regression was wanted or not.
Updated by mame (Yusuke Endoh) about 12 years ago
- Status changed from Open to Assigned
- Assignee set to shugo (Shugo Maeda)
- Target version set to 2.0.0
If I recall, this is an intentional change since 1.9.3.
Shugo-san, could you check give him a reference to the discussion and close this ticket?
--
Yusuke Endoh mame@tsg.ne.jp
Updated by shugo (Shugo Maeda) about 12 years ago
- Assignee changed from shugo (Shugo Maeda) to mame (Yusuke Endoh)
mame (Yusuke Endoh) wrote:
If I recall, this is an intentional change since 1.9.3.
Shugo-san, could you check give him a reference to the discussion and close this ticket?
Do you mean Bug #4536?
It seems that foobar_spec.rb fails even if the fix of #4536 (r31215) is reverted.
Or do you mean another issue?
I don't know rspec well, but the comment of this ticket stated that this issue is related to #3422, and
I don't know anything about #3422.
Updated by mame (Yusuke Endoh) about 12 years ago
- Status changed from Assigned to Rejected
- Assignee changed from mame (Yusuke Endoh) to shugo (Shugo Maeda)
I meant your answers in these tickets:
https://bugs.ruby-lang.org/issues/6838
https://bugs.ruby-lang.org/issues/5777
As far as I know, #instance_eval with block changed constant lookup scope in 1.9.2, but it has stopped since 1.9.3.
The rspec behavior looks affected by this spec change.
I'm closing this ticket, but please tell me if I'm wrong.
Thank you,
--
Yusuke Endoh mame@tsg.ne.jp
Updated by shugo (Shugo Maeda) about 12 years ago
mame (Yusuke Endoh) wrote:
I meant your answers in these tickets:
https://bugs.ruby-lang.org/issues/6838
https://bugs.ruby-lang.org/issues/5777As far as I know, #instance_eval with block changed constant lookup scope in 1.9.2, but it has stopped since 1.9.3.
The rspec behavior looks affected by this spec change.
In 1.9.2, constant lookup in instance_eval or module_eval had already been reverted to the behavior of 1.8,
but there was a bug (#4536) in 1.9.2, and the bug was fixed in 1.9.3.
So I suspected that the fix of #4536 is related to this issue, but foobar_spec.rb fails even if the fix is reverted.
Anyway, the current behavior is intended. The following code illustrates why foobar_spec.rb fails in 1.9.3.
module Foo
X = 1
end
o = Object.new
o.extend(Foo)
o.instance_eval {
p X
}
This code prints 1 in 1.9.2, but raises a NameError in 1.8 and 1.9.3.
I don't know when this bug of 1.9.2 was fixed.