I'm currently looking to set up a hash in memory that can be used across my entire suite I am looking to do the following
RSpec.configure do |config|
config.before(:suite) { $user_tokens = initialize_my_stuff }
end
However, when I go to run my suite, I get an error from one of my specs with this error:
NoMethodError: undefined method 'each' for nil:NilClass
It's trying to run this:
$user_tokens.each do |user,token|
describe 'foo bar' do
...
end
end
If I comment out this spec, the before(:suite) runs as expected.
Is there a way I can ensure that the before(:suite) block runs before attempting to do anything with the specs?