Project

General

Profile

Actions

Bug #7213

closed

Namespace regression problem in RSpec from 1.9.2 to 1.9.3

Added by aef (Alexander E. Fischer) over 11 years ago. Updated over 11 years ago.

Status:
Rejected
Target version:
ruby -v:
1.9.3
Backport:
[ruby-core:48208]

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) over 11 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

Updated by shugo (Shugo Maeda) over 11 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) over 11 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

Updated by shugo (Shugo Maeda) over 11 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/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.

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.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0