summaryrefslogtreecommitdiff
path: root/spec/hashie/mash_spec.rb
diff options
context:
space:
mode:
authorPeter Goldstein <peter.m.goldstein@gmail.com>2023-01-13 13:53:14 -0500
committerGitHub <noreply@github.com>2023-01-13 13:53:14 -0500
commit2b3120ad4a6f54990dfec5b10f5769e3714ab1e8 (patch)
tree0a0bc6c282736648179aaa584e9d4a58271aac89 /spec/hashie/mash_spec.rb
parent6fabbfd31af5952f363a8dc573bfa2059e41371d (diff)
downloadhashie-2b3120ad4a6f54990dfec5b10f5769e3714ab1e8.tar.gz
Add Ruby 3.2 to the CI matrix (#571)HEADmaster
* Adds Ruby 3.2 to the CI matrix * Use object_id rather than trust, as trust is no longer a method on Object in Ruby 3.2. Condition checked on Psych error based on version of Psych. * Update danger token * Add CHANGELOG entry * Add use of Gem::Version for version comparison
Diffstat (limited to 'spec/hashie/mash_spec.rb')
-rw-r--r--spec/hashie/mash_spec.rb17
1 files changed, 12 insertions, 5 deletions
diff --git a/spec/hashie/mash_spec.rb b/spec/hashie/mash_spec.rb
index 03f5668..091748f 100644
--- a/spec/hashie/mash_spec.rb
+++ b/spec/hashie/mash_spec.rb
@@ -137,9 +137,9 @@ describe Hashie::Mash do
include_context 'with a logger' do
it 'logs a warning when overriding built-in methods' do
- Hashie::Mash.new('trust' => { 'two' => 2 })
+ Hashie::Mash.new('object_id' => { 'two' => 2 })
- expect(logger_output).to match('Hashie::Mash#trust')
+ expect(logger_output).to match('Hashie::Mash#object_id')
end
it 'can set keys more than once and does not warn when doing so' do
@@ -821,9 +821,16 @@ describe Hashie::Mash do
expect(mash.company_a.accounts.admin.password).to eq('secret')
end
it 'can override the value of aliases' do
- expect do
- Hashie::Mash.load('spec/fixtures/yaml_with_aliases.yml', aliases: false)
- end.to raise_error Psych::BadAlias, /base_accounts/
+ require 'psych'
+ if Gem::Version.new(Psych::VERSION) >= Gem::Version.new('5')
+ expect do
+ Hashie::Mash.load('spec/fixtures/yaml_with_aliases.yml', aliases: false)
+ end.to raise_error Psych::AliasesNotEnabled, /Alias parsing was not enabled/
+ else
+ expect do
+ Hashie::Mash.load('spec/fixtures/yaml_with_aliases.yml', aliases: false)
+ end.to raise_error Psych::BadAlias, /base_accounts/
+ end
end
end