aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/secrets_test.rb
diff options
context:
space:
mode:
authorMatthew Draper <matthew@trebex.net>2017-09-04 02:25:26 +0930
committerMatthew Draper <matthew@trebex.net>2017-09-04 20:19:39 +0930
commit802ce8a2392d3f749e665d4f9e54790cf613aaf9 (patch)
treec918e029aabc60a84afe7714030e35e81dffc0ec /railties/test/secrets_test.rb
parent07bac9ef93d98a1e31cd5b2ce2aabc1e57816604 (diff)
downloadrails-802ce8a2392d3f749e665d4f9e54790cf613aaf9.tar.gz
rails-802ce8a2392d3f749e665d4f9e54790cf613aaf9.tar.bz2
rails-802ce8a2392d3f749e665d4f9e54790cf613aaf9.zip
Run in-app rails commands via fork+load where possible
While this avoids shell argument parsing, we still pass through everything in our stack.
Diffstat (limited to 'railties/test/secrets_test.rb')
-rw-r--r--railties/test/secrets_test.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/railties/test/secrets_test.rb b/railties/test/secrets_test.rb
index ff6f955a78..631c6a13fe 100644
--- a/railties/test/secrets_test.rb
+++ b/railties/test/secrets_test.rb
@@ -108,7 +108,7 @@ class Rails::SecretsTest < ActiveSupport::TestCase
config.dereferenced_secret = Rails.application.secrets.some_secret
end_of_config
- assert_equal "yeah yeah\n", `bin/rails runner -e production "puts Rails.application.config.dereferenced_secret"`
+ assert_equal "yeah yeah\n", rails("runner", "-e", "production", "puts Rails.application.config.dereferenced_secret", fork: false)
end
end
@@ -141,7 +141,7 @@ class Rails::SecretsTest < ActiveSupport::TestCase
assert_match(/production:\n\s*api_key: 00112233445566778899aabbccddeeff…\n/, File.read(tmp_path))
end
- assert_equal "00112233445566778899aabbccddeeff…\n", `bin/rails runner -e production "puts Rails.application.secrets.api_key"`
+ assert_equal "00112233445566778899aabbccddeeff…\n", rails("runner", "-e", "production", "puts Rails.application.secrets.api_key", fork: false)
end
end
@@ -158,7 +158,7 @@ class Rails::SecretsTest < ActiveSupport::TestCase
assert_equal(secrets.dup.force_encoding(Encoding::ASCII_8BIT), IO.binread(tmp_path))
end
- assert_equal "00112233445566778899aabbccddeeff…\n", `bin/rails runner -e production "puts Rails.application.secrets.api_key"`
+ assert_equal "00112233445566778899aabbccddeeff…\n", rails("runner", "-e", "production", "puts Rails.application.secrets.api_key", fork: false)
end
end