do not search ancestors when checking Test::Unit.const_defined? #73

merged 1 commit into from Sep 10, 2012


None yet
2 participants

Fix a false-positive detection of Test::Unit::Notification being defined due to const_defined? searching up the object heirarchy by default, which results in an uninitialized-constant-name-error at runtime if e.g. :Notification is defined elsewhere.

[1] pry(main)> Test::Unit.const_defined?(:Notification)
=> true
[2] pry(main)> Test::Unit.const_defined?(:Notification, false)
=> false
[5] pry(main)> Object.const_defined?(:Notification, false)
=> true

(Introduced in this commit: e7a0ff8

nicksieger added a commit that referenced this pull request Sep 10, 2012

Merge pull request #73 from seanwalbran/fix-const-defined-false-positive
do not search ancestors when checking Test::Unit.const_defined?

@nicksieger nicksieger merged commit d20a340 into ci-reporter:master Sep 10, 2012


nicksieger commented Sep 10, 2012

Thanks Sean! (sigh on the const_defined? collision).

Thanks for the quick merge, much appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment