laserlemon / figaro

Simple Rails app configuration
MIT License
3.77k stars 288 forks source link

Accessing variables in minitest #185

Open tquill opened 9 years ago

tquill commented 9 years ago

I'm sure I'm missing something, but my ENV variables are all blank when I'm running tests.

What am I doing wrong?

For my setup, I added the figaro gem to my gem file, used the "figaro install" command, and added some variables to my application.yml file. Everything seems to work great, except when it comes to testing.

Do I need to require figaro somewhere else, like in in my application.rb or test_helper.rb?

tquill commented 9 years ago

I figured out it has something to do with using guard. If I run the command "bundle exec rake test" instead... everything seems to work. Running tests via guard though, works inconsistently. I've had it work with guard before, so it seems there's some sort of loading sequence issue.