-
Notifications
You must be signed in to change notification settings - Fork 68
Fix psych disallowedclass error in ruby 3.1 #256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Fix psych disallowedclass error in ruby 3.1 #256
Conversation
a1d3f9b
to
ac89c4c
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #256 +/- ##
=======================================
Coverage 97.26% 97.27%
=======================================
Files 20 20
Lines 658 660 +2
Branches 148 148
=======================================
+ Hits 640 642 +2
Misses 18 18 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
require 'date' | ||
require 'time' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nits]
require 'yaml'
also loads Date
. Time
is available without requiring anything explicitly.
require 'spec_helper' | ||
|
||
RSpec.describe RSpec::OpenAPI::SchemaFile do | ||
describe '#read' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[imho]
How about adding unquoted dates or times to the OpenAPI schema in spec/apps/
instead of writing tests for the private method?
What should be tested is not whether unquoted dates or times are loaded, but whether the resulting OpenAPI schema output is correct—and whether it can be successfully loaded.
Fixes #249 by adding
Date
topermitted_classes
ofYAML.safe_load
inRSpec::OpenAPI::SchemaFile#read
.Changes