-
Notifications
You must be signed in to change notification settings - Fork 44
Open
Description
I often have the problem that there are minor differences between the output of an approval test in jruby and mri. We run our tests in both rubies so the approval test always fails for such cases in one of the rubies.
An example of this is that the following generates different approvals in jruby and mri:
verify(format: :json) { { weight: {} } }
In jruby:
weight: {
}
in mri:
weight: {
}
Is there any way to avoid this?
The problem seems to be jsons pretty_generate: https://github.com/kytrinyx/approvals/blob/master/lib/approvals/writers/json_writer.rb#L11
jruby:
JSON.pretty_generate({ weight: {} })
=> "{\n \"weight\": {\n\n }\n}"`
mri:
JSON.pretty_generate({ weight: {} })
=> "{\n \"weight\": {\n }\n}"
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels