diff --git a/spec/sections_spec.rb b/spec/sections_spec.rb index 457a031..b4b5bba 100644 --- a/spec/sections_spec.rb +++ b/spec/sections_spec.rb @@ -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