diff --git a/lib/rspec/openapi/result_recorder.rb b/lib/rspec/openapi/result_recorder.rb index 49e60d9..676e29f 100644 --- a/lib/rspec/openapi/result_recorder.rb +++ b/lib/rspec/openapi/result_recorder.rb @@ -10,7 +10,11 @@ def record_results! @path_records.each do |path, records| # Look for a path-specific config file and run it. config_file = File.join(File.dirname(path), RSpec::OpenAPI.config_filename) - eval(File.read(config_file)) if File.exist?(config_file) + begin + require config_file if File.exist?(config_file) + rescue => e + puts "WARNING: Unable to load #{config_file}: #{e}" + end title = RSpec::OpenAPI.title RSpec::OpenAPI::SchemaFile.new(path).edit do |spec|