Skip to content

Commit

Permalink
fix yaml load
Browse files Browse the repository at this point in the history
  • Loading branch information
zed-0xff committed Jan 29, 2022
1 parent 07b1d8d commit 76a45f7
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion spec/sections_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,20 @@
['calc.exe', 'bad/data_dir_15_entries.exe'].each do |fname|
describe fname do
it "should match saved sections info" do
sample.sections.should == YAML::load_file(File.join(DATA_DIR,"#{File.basename(fname)}_sections.yml"))
sections = nil
begin
# tested with ruby 3.0.3
sections = YAML::load_file(
File.join(DATA_DIR,"#{File.basename(fname)}_sections.yml"),
permitted_classes: [Symbol, PEdump::IMAGE_SECTION_HEADER]
)
rescue
# old ruby?
sections = YAML::load_file(
File.join(DATA_DIR,"#{File.basename(fname)}_sections.yml")
)
end
sample.sections.should == sections
end
end
end

0 comments on commit 76a45f7

Please sign in to comment.