Change `yaml` to `YAML`

This commit is contained in:
John Bampton 2022-03-29 15:19:22 +10:00
parent d907b4420e
commit 3b7f55c179
6 changed files with 11 additions and 11 deletions

View File

@ -13,7 +13,7 @@ class ParametersSerializationTest < ActiveSupport::TestCase
ActionController::Parameters.permit_all_parameters = @old_permitted_parameters
end
test "yaml serialization" do
test "YAML serialization" do
params = ActionController::Parameters.new(key: :value)
yaml_dump = YAML.dump(params)
assert_match("--- !ruby/object:ActionController::Parameters", yaml_dump)
@ -21,7 +21,7 @@ class ParametersSerializationTest < ActiveSupport::TestCase
assert_match("permitted: false", yaml_dump)
end
test "yaml deserialization" do
test "YAML deserialization" do
params = ActionController::Parameters.new(key: :value)
payload = YAML.dump(params)
roundtripped = YAML.respond_to?(:unsafe_load) ? YAML.unsafe_load(payload) : YAML.load(payload)
@ -30,7 +30,7 @@ class ParametersSerializationTest < ActiveSupport::TestCase
assert_not_predicate roundtripped, :permitted?
end
test "yaml backwardscompatible with psych 2.0.8 format" do
test "YAML backwardscompatible with psych 2.0.8 format" do
payload = <<~end_of_yaml
--- !ruby/hash:ActionController::Parameters
key: :value
@ -41,7 +41,7 @@ class ParametersSerializationTest < ActiveSupport::TestCase
assert_not_predicate params, :permitted?
end
test "yaml backwardscompatible with psych 2.0.9+ format" do
test "YAML backwardscompatible with psych 2.0.9+ format" do
payload = <<~end_of_yaml
--- !ruby/hash-with-ivars:ActionController::Parameters
elements:

View File

@ -11,7 +11,7 @@ end
class ActionControllerParametersIntegrationTest < ActionController::TestCase
tests IntegrationController
test "parameters can be serialized as yaml" do
test "parameters can be serialized as YAML" do
post :yaml_params, params: { person: { name: "Mjallo!" } }
expected = <<~YAML
--- !ruby/object:ActionController::Parameters

View File

@ -11,7 +11,7 @@ module ActiveRecord
# the connection pool.
#
# Configure the frequency by setting +reaping_frequency+ in your database
# yaml file (default 60 seconds).
# YAML file (default 60 seconds).
class Reaper
attr_reader :pool, :frequency

View File

@ -3,7 +3,7 @@
require_relative "abstract_unit"
class ConfigurationFileTest < ActiveSupport::TestCase
test "backtrace contains yaml path" do
test "backtrace contains YAML path" do
Tempfile.create do |file|
file.write("wrong: <%= foo %>")
file.rewind
@ -16,7 +16,7 @@ class ConfigurationFileTest < ActiveSupport::TestCase
end
end
test "backtrace contains yaml path (when Pathname given)" do
test "backtrace contains YAML path (when Pathname given)" do
Tempfile.create do |file|
file.write("wrong: <%= foo %>")
file.rewind

View File

@ -723,7 +723,7 @@ The Redis adapter requires users to provide a URL pointing to the Redis server.
Additionally, a `channel_prefix` may be provided to avoid channel name collisions
when using the same Redis server for multiple applications. See the [Redis PubSub documentation](https://redis.io/topics/pubsub#database-amp-scoping) for more details.
The Redis adapter also supports SSL/TLS connections. The required SSL/TLS parameters can be passed in `ssl_params` key in the configuration yaml file.
The Redis adapter also supports SSL/TLS connections. The required SSL/TLS parameters can be passed in `ssl_params` key in the configuration YAML file.
```
production:

View File

@ -1960,7 +1960,7 @@ module ApplicationTests
assert_equal true, Rails.application.config.action_mailer.show_previews
end
test "config_for loads custom configuration from yaml accessible as symbol or string" do
test "config_for loads custom configuration from YAML accessible as symbol or string" do
set_custom_config <<~RUBY
development:
foo: "bar"
@ -1972,7 +1972,7 @@ module ApplicationTests
assert_equal "bar", Rails.application.config.my_custom_config["foo"]
end
test "config_for loads nested custom configuration from yaml as symbol keys" do
test "config_for loads nested custom configuration from YAML as symbol keys" do
set_custom_config <<~RUBY
development:
foo: