Skip to content
This repository has been archived by the owner on Mar 14, 2019. It is now read-only.

Update dependencies #19

Merged
merged 10 commits into from
Sep 16, 2015
Merged

Update dependencies #19

merged 10 commits into from
Sep 16, 2015

Conversation

simeonwillbanks
Copy link
Contributor

Problem

Dependencies are out of date.

Solution

  • bundle update
  • rake bower:install

@@ -19,7 +19,7 @@ gem "cron2english"
group :test, :development do
gem "capybara"
gem "selenium-webdriver"
gem "teaspoon"
gem "teaspoon-jasmine"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@simeonwillbanks
Copy link
Contributor Author

@davetron5000 Do we want to upgrade Rails?

@davetron5000
Copy link
Contributor

Yeah go for it. The tests should be solid and I can check in on izombie over the weekend or early morning.

Dave

(Sent from my iPhone [I CAN spell])

On Aug 14, 2015, at 5:26 PM, Simeon Willbanks [email protected] wrote:

@davetron5000 Do we want to upgrade Rails?


Reply to this email directly or view it on GitHub.

…sets` has been renamed to `config.serve_static_files`
  - `rake test` raised "NoMethodError: undefined method `lib_require' for main:Object"
  - Adding `puts ENV['RAILS_ENV']` printed "test", so refactor
    conditional to defined #lib_require in test environment
def rails_require(*)
end
else
if ENV['RAILS_ENV'] == "test"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@davetron5000 Make sense to you? Wasn't sure of your original intent. Thanks!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The intent was to define rails_require as a no-op if we were running in any rails environment. Granted, it would only be one where it was "test" but the original version was what I intended (even though I see how it's not really clear what it was doing).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this change, a NoMethodError is raised.

❯ bundle exec rake test
rake aborted!
NoMethodError: undefined method `lib_require' for main:Object
/Users/simeonwillbanks/Code/resque-brain/test/lib/monitoring/failed_job_check_test.rb:6:in `<top (required)>'
Tasks: TOP => test:run
(See full trace by running task with --trace)

Thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird, this does not happen for me. I guess it can't hurt? But it seems odd…

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh.

It looks like lib_require was added after rails_require, and lib_require is only used in tests.

If you add puts ENV['RAILS_ENV'], does it print anything while running bundle exec rake test? Thanks!

puts ENV['RAILS_ENV']
if ENV['RAILS_ENV']
  def rails_require(*)
  end
else
  $: << File.expand_path(File.join(File.dirname(__FILE__),'..'))
  def rails_require(file)
    require "app/#{file}"
  end

  def lib_require(file)
    require "lib/#{file}"
  end
end
❯ bundle exec rake test
test
rake aborted!
NoMethodError: undefined method `lib_require' for main:Object
/Users/simeonwillbanks/Code/resque-brain/test/lib/monitoring/failed_job_check_test.rb:6:in `<top (required)>'
Tasks: TOP => test:run
(See full trace by running task with --trace)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It prints "test". Note that it's defined in test/test_helper.rb, so I wonder if there's some randomness in file load order?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@davetron5000 I tried reverting f9e7708, and the build failed. Thoughts on keeping the refactored conditional? Thanks!

#19 (comment)

Revert "Fix NoMethodError in test suite"

This reverts commit f9e7708.
Revert "Reverting since might be an issue with my local environment"

This reverts commit be7148c.
simeonwillbanks added a commit that referenced this pull request Sep 16, 2015
@simeonwillbanks simeonwillbanks merged commit 8798b8d into master Sep 16, 2015
@simeonwillbanks simeonwillbanks deleted the update-dependencies branch September 16, 2015 20:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants