curationexperts/sufia — pull request #64 by mjgiarlo (2013-04-12 02:41:49+00:00)
Title: Mock and work around FITS when running specs in travis-ci

Three different strategies in place here:

1. First, in `spec_helper.rb`, if we're running in the travis-ci environment then set the `$in_travis` global variable to true;
2. Then, if `$in_travis` is true, monkey-patch the `Sufia::FileContent::ExtractMetadata.run_fits!` method to return a FITS XML fixture for the bits of code that depend upon this method doing something FITS-like;
3. Next, use the `:unless => $in_travis` conditional to completely skip specs that are just for testing FITS;
4. Finally, in specs where the dummy FITS XML above causes problems, do some creative stubbing to work around that.

Is this too evil?