Closed jimweirich closed 11 years ago
If a spec is nested inside of a module, constant names are not correctly evaluated when errors occur.
For example:
RSpec::Given.use_natural_assertions module Argus describe Drone do Given(:drone) { Drone.new } Then { drone.name == Drone::NAME } end end
will produce the following error message:
1) Argus::Drone Failure/Error: Then { drone.name == Drone::NAME } Then expression failed at /Users/jim/working/git/argus/examples/xx_spec.rb:17 expected: "Amelia" to equal: NameError: uninitialized constant RSpec::Given::InstanceExtensions::Drone NameError: uninitialized constant RSpec::Given::InstanceExtensions::Drone <- drone.name == Drone::NAME "Amelia" <- drone.name #<Argus::Drone:0x007fef24953f88> <- drone NameError: uninitialized constant RSpec::Given::InstanceExtensions::Drone <- Drone::NAME NameError: uninitialized constant RSpec::Given::InstanceExtensions::Drone <- Drone # ./examples/xx_spec.rb:17:in `block in Then'
Fixed in 2.4.1.
If a spec is nested inside of a module, constant names are not correctly evaluated when errors occur.
For example:
will produce the following error message: