Skip to content
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

Adjust tests to reflect OpenStruct changes on Ruby3.0 #102

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sergiodj
Copy link

Ref.: ruby/psych#540

OpenStruct on Ruby3.0 changed its marshalling/unmarshalling code,
which is now impacting safe_yaml's testcase. The two adjustments that
needed to be made are:

  • OpenStruct's instance_variable_get will now symbolize its hash keys,
    instead of using strings.

  • OpenStruct's to_yaml method will not output the table entity
    anymore.

Ref.: ruby/psych#540

OpenStruct on Ruby3.0 changed its marshalling/unmarshalling code,
which is now impacting safe_yaml's testcase.  The two adjustments that
needed to be made are:

- OpenStruct's instance_variable_get will now symbolize its hash keys,
  instead of using strings.

- OpenStruct's to_yaml method will not output the 'table' entity
  anymore.

Signed-off-by: Sergio Durigan Junior <sergiodj@sergiodj.net>
@sergiodj
Copy link
Author

Honestly, I am not entirely sure this is the right fix for this issue.
It seems to me that, because the underlying reason for the failures is
actually a change of behaviour of OpenStruct, safe_yaml should just
follow suit and adjust the expected output. However, these failures
can also be a symptom of some real bug in the library.

Either way, I defer to the opinion of the Ruby experts that will
hopefully review this change. TIA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant