-
Notifications
You must be signed in to change notification settings - Fork 18
Conversation
@@ -19,7 +19,7 @@ gem "cron2english" | |||
group :test, :development do | |||
gem "capybara" | |||
gem "selenium-webdriver" | |||
gem "teaspoon" | |||
gem "teaspoon-jasmine" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@davetron5000 Do we want to upgrade Rails? |
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])
|
…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
…n option `active_support.test_order`.
def rails_require(*) | ||
end | ||
else | ||
if ENV['RAILS_ENV'] == "test" |
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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…
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
Problem
Dependencies are out of date.
Solution
bundle update
rake bower:install