Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Modules included in example groups aren't visible in Ruby 1.9.3 #506
In Ruby 1.9.3, when including a module in an example group, constants defined in the module aren't in scope:
This fails with "NameError: uninitialized constant Y".
This worked fine in 1.9.2, so it seemed like a Ruby change caused the regression. It happens both with rspec-core 2.6.0 and 2.7.1.
Looks like a Ruby bug:
module X module Y def self.a puts 'a' end end end class Foo end a = Class.new(Foo) do include X def self.b Y.a end end puts a.b # => uninitialized constant Y (NameError)
Looks like 1.9.3 has a bug with "block evaluation" (