Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing test dependences to Appraisals #527

Merged
merged 1 commit into from
Jun 13, 2014

Conversation

mcmire
Copy link
Collaborator

@mcmire mcmire commented May 21, 2014

Since as of commit 2748b75, we no longer install dependencies inside of the Rails app that is generated and used to run all of the tests, we have to require all of the dependencies that the app would install inside of the appropriate Appraisals. This will unbreak the test suite (as currently it's broken, whoops ;))

This was mostly straightforward except for some workarounds with the turn gem:

  • Rails 3.1 requires two versions of turn depending on which Ruby version you're using. On 1.9.2, it uses turn 0.9.2; after 1.9.2, it uses ~> 0.9.3. To accommodate this we have to have two versions of the
    Rails 3.1 appraisal which declare the different turn versions.
  • Rails 3.1 also loads the turn gem even if, in the Gemfile for the app, turn is declared with require: false. This causes a problem while running our tests because turn actually requires minitest/autorun, which adds a hook so when Ruby exits, Minitest tests are run. Because we're already using RSpec, Minitest will try to re-run the rspec command we ran within a Minitest environment. This will fail since we are using RSpec-specific command line options to run the tests. Unfortunately there's no way to shut off minitest/autorun after it's been required, so we have to monkey-patch Minitest's #run method so it's a no-op.

Since as of commit 2748b75, we no
longer install dependencies inside of the Rails app that is generated
and used to run all of the tests, we have to require all of the
dependencies that the app would install inside of the appropriate
Appraisals.

This was mostly straightforward except for some workarounds with the
turn gem:

* Rails 3.1 requires two versions of turn depending on which Ruby
  version you're using. On 1.9.2, it uses turn 0.9.2; after 1.9.2, it
  uses ~> 0.9.3. To accommodate this we have to have two versions of the
  Rails 3.1 appraisal which declare the different turn versions.
* Rails 3.1 also loads the turn gem even if, in the Gemfile for the app,
  turn is declared with `require: false`. This causes a problem while
  running our tests because turn actually requires minitest/autorun,
  which adds a hook so when Ruby exits, Minitest tests are run. Because
  we're already using RSpec, Minitest will try to re-run the `rspec`
  command we ran within a Minitest environment. This will fail since we
  are using RSpec-specific command line options to run the tests.
  Unfortunately there's no way to shut off minitest/autorun after it's
  been required, so we have to monkey-patch Minitest's #run method so
it's a no-op.
@mrageh
Copy link

mrageh commented Jun 13, 2014

@mcmire I think this should be merged soon to make more builds pass on other people's pr's.

@mcmire
Copy link
Collaborator Author

mcmire commented Jun 13, 2014

@Adam89 I agree, sorry. I am so behind...

@lunks
Copy link
Contributor

lunks commented Jun 13, 2014

Waiting for this one to be merged to rebase #540 against master.

@mcmire mcmire merged commit f13e069 into master Jun 13, 2014
@mcmire mcmire deleted the ew-add-addl-deps-to-appraisals branch June 13, 2014 23:26
@mcmire
Copy link
Collaborator Author

mcmire commented Jun 13, 2014

@lunks I apologize for the wait, it's merged now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants