Skip to content

Commit

Permalink
Merge pull request #39 from jrafanie/use_unsafe_load_for_specific_tests
Browse files Browse the repository at this point in the history
Use unsafe_load to load a test file with unpermitted classes
  • Loading branch information
agrare authored Nov 17, 2023
2 parents d8d853f + 35d47c4 commit 31f0788
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 31f0788

Please sign in to comment.