Skip to content

Commit

Permalink
rebase, adjust tests
Browse files Browse the repository at this point in the history
  • Loading branch information
siegy22 committed Jan 26, 2017
1 parent d27f11d commit 0734ca1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
9 changes: 5 additions & 4 deletions spec/dotenv/rails_development_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,19 @@ def add(*items)
expect(Spring.watcher.items).to include(path)
end

it "loads .env, .env.local, and .env.#{Rails.env}" do
it "loads .env, .env.#{Rails.env}, .env.local, and .env.#{Rails.env}.local" do
expect(Dotenv::Railtie.instance.send(:dotenv_files)).to eql(
[
Rails.root.join(".env.development.local"),
Rails.root.join(".env.local"),
Rails.root.join(".env.development"),
Rails.root.join(".env")
Rails.root.join(".env"),
]
)
end

it "loads .env.local before .env" do
expect(ENV["DOTENV"]).to eql("local")
it "loads .env.#{Rails.env}.local on top" do
expect(ENV["DOTENV"]).to eql("development-local")
end
end
end
6 changes: 3 additions & 3 deletions spec/dotenv/rails_test_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ def add(*items)
it "does not load .env.local in test rails environment" do
expect(Dotenv::Railtie.instance.send(:dotenv_files)).to eql(
[
Rails.root.join(".env.test.local").to_s,
Rails.root.join(".env.test").to_s,
Rails.root.join(".env").to_s
Rails.root.join(".env.test.local"),
Rails.root.join(".env.test"),
Rails.root.join(".env"),
]
)
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM_RAILS_ENV=.env.test
FROM_LOCAL=true
DOTENV=local
DOTENV=development-local

0 comments on commit 0734ca1

Please sign in to comment.