rails/rails — pull request #3845 by sumbach (2011-12-03 17:35:09+00:00)
Title: Add tests for the return value of require

Following 4da45060a2e839fec4a7e9238cbc9d8de62b1b69 on 20110214, RubyInline no longer worked with config.cache_classes = false. This was due to a change in the return value from require:

* Prior to the change, require returned an array of new constants added by the required file.
* While this was not consistent with Kernel#require, the result was always truthy.
* Following the change, require returned either an array of new constants added by the required file or nil if requiring the file did not cause any new constants to be defined.
* This change was incompatible with RubyInline since it first requires a Ruby source file (which defines the constants), then requires a shared object file (which includes implementation but doesn't necessarily define any additional constants).

Ryan Davis submitted a fix for this bug (merged on 20110823).

* a10606c490471d8e1483acb3b31d7f2d51e9ebbe (master)
* b359628f18cd0830654e239ee56845c29be13989 (3-1-stable)
* 7c5cd40710228a027c26335a711b728e9322caac (3-1-stable)

This patch adds tests to ensure Loadable#require remains consistent with Kernel#require sementics, and protect against future regressions in require's return value behavior.