pivotal/jasmine — pull request #205 by mark-rushakoff (2012-03-22 04:10:51+00:00)
Title: Ensure order of globbed files in task helpers

The [docs for `Dir.glob` state](http://ruby-doc.org/core-1.9.3/Dir.html#method-c-glob):

> Note that case sensitivity depends on your system (so File::FNM_CASEFOLD is ignored), as does the order in which the results are returned.

So when I ran `rake:spec` on Ubuntu 11.10 with an ext3 filesystem, the source files in my `runner.html` were in a seemingly arbitrary order:

This resulted in the following runtime errors:

SuiteView.js:1 Uncaught TypeError: Cannot set property 'SuiteView' of undefined
ReporterView.js:1 Uncaught TypeError: Cannot set property 'ReporterView' of undefined
HtmlReporter.js:22 Uncaught TypeError: undefined is not a function

After applying this fix, my script sources were the same as the runner.html that is currently checked in to the upstream master branch:

There are still several places where I didn't sort Dir.glob:

* `jasmine-core.gemspec` and `lib/jasmine-core.rb` because I didn't have a way to test either of them
* `tasks/build_dist.rb` which globbed a single file without wildcards: `Dir.glob('src/version.js')`
* `tasks/spec.rb` which was just globbing files for the purpose of counting specs