Skip to content

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 sergiodj force-pushed the adjust-tests-ostruct-ruby3.0 branch from 09834c7 to 024c5c6 Compare January 28, 2022 21:59
@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