Skip to content

Commit b838f30

Browse files
committed
Correct a Psych::DisallowedClass error in tests
After upgrading to Ruby 3.1, following error raises when running redmine_git_hosting tests depending on loading a fixture based on a YAML file: Psych::DisallowedClass: Tried to load unspecified class: Time
1 parent 0c803df commit b838f30

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

spec/support/global_helpers.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ def create_svn_repository(**opts)
8484
end
8585

8686
def load_yaml_fixture(fixture)
87-
YAML.load load_fixture(fixture) # rubocop: disable Security/YAMLLoad
87+
YAML.load load_fixture(fixture), # rubocop: disable Security/YAMLLoad
88+
permitted_classes: [Symbol, Time] if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.1.0')
8889
end
8990

9091
def load_fixture(fixture)

0 commit comments

Comments
 (0)