Skip to content

Commit 6561231

Browse files
committed
Fix bugs with loading the environment so that .env.test.local works
1 parent 68e8093 commit 6561231

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

Rakefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,4 @@ RuboCop::RakeTask.new
99

1010
task default: %i[spec rubocop]
1111

12-
require_relative "local_playground"
13-
1412
require "resque/tasks"

local_playground.rb

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@
55

66
require "foobara/load_dotenv"
77

8-
# TODO: setup boot pattern here
9-
# TODO: this is wrong, change to not pass in anything and set the environment elsewhere
10-
Foobara::LoadDotenv.run!(env: "development")
8+
Foobara::LoadDotenv.run!
119

1210
require "foobara/resque_connector"
1311

1412
if ENV["REDIS_URL"]
1513
Resque.redis = Redis.new(url: ENV["REDIS_URL"])
1614
else
17-
raise NoRedisUrlError,
18-
'Must set ENV["REDIS_URL"] if trying to initialize RedisCrudDriver with no arguments'
15+
# :nocov:
16+
raise 'Must set ENV["REDIS_URL"] if trying to initialize RedisCrudDriver with no arguments'
17+
# :nocov:
1918
end

spec/spec_helper.rb

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
ENV["FOOBARA_ENV"] = "test"
2+
13
require "bundler/setup"
24

35
require "pry"
@@ -30,9 +32,6 @@
3032
# config.raise_errors_for_deprecations!
3133
end
3234

33-
require "foobara/load_dotenv"
34-
35-
Foobara::LoadDotenv.run!(env: "test")
36-
37-
require "foobara/resque_connector"
3835
require "foobara/spec_helpers/all"
36+
37+
require_relative "../local_playground"

0 commit comments

Comments
 (0)