Skip to content

Commit

Permalink
Use unsafe_load to load a test file with unpermitted classes
Browse files Browse the repository at this point in the history
  • Loading branch information
jrafanie committed Nov 16, 2023
1 parent d8d853f commit 35d47c4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
require 'yaml'
def load_response_mock_for(filename)
prefix = described_class.name.underscore
YAML.load_file(File.join('spec', 'models', prefix, 'response_yamls', filename + '.yml'))
YAML.unsafe_load(File.read(File.join('spec', 'models', prefix, 'response_yamls', filename + '.yml')))
end

before(:each) do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@ def init_inventory_wrapper_class

def load_response_mock_for(filename)
prefix = described_class.name.underscore
YAML.load_file(File.join('spec', 'models', prefix, 'response_yamls', filename + '.yml'))
YAML.unsafe_load(File.read(File.join('spec', 'models', prefix, 'response_yamls', filename + '.yml')))
end
end

0 comments on commit 35d47c4

Please sign in to comment.