spec/rails_spec.rb in figaro-1.1.1 vs spec/rails_spec.rb in figaro-1.2.0
- old
+ new
@@ -1,50 +1,55 @@
describe Figaro::Rails do
before do
- run_simple(<<-CMD)
+ run_command_and_stop(<<-CMD)
rails new example \
--skip-gemfile \
- --skip-bundle \
+ --skip-git \
--skip-keeps \
--skip-sprockets \
+ --skip-spring \
+ --skip-listen \
--skip-javascript \
- --skip-test-unit \
+ --skip-turbolinks \
+ --skip-test \
+ --skip-bootsnap \
--no-rc \
- --quiet
+ --skip-bundle \
+ --skip-webpack-install
CMD
cd("example")
end
describe "initialization" do
before do
write_file("config/application.yml", "foo: bar")
end
it "loads application.yml" do
- run_simple("rails runner 'puts Figaro.env.foo'")
+ run_command_and_stop("rails runner 'puts Figaro.env.foo'")
- assert_partial_output("bar", all_stdout)
+ expect(all_stdout).to include("bar")
end
it "happens before database initialization" do
write_file("config/database.yml", <<-EOF)
development:
adapter: sqlite3
database: db/<%= ENV["foo"] %>.sqlite3
EOF
- run_simple("rake db:migrate")
+ run_command_and_stop("rake db:migrate")
- check_file_presence(["db/bar.sqlite3"], true)
+ expect("db/bar.sqlite3").to be_an_existing_file
end
it "happens before application configuration" do
insert_into_file_after("config/application.rb", /< Rails::Application$/, <<-EOL)
config.foo = ENV["foo"]
EOL
- run_simple("rails runner 'puts Rails.application.config.foo'")
+ run_command_and_stop("rails runner 'puts Rails.application.config.foo'")
- assert_partial_output("bar", all_stdout)
+ expect(all_stdout).to include("bar")
end
end
end