Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion test/json/ractor_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@
end

class JSONInRactorTest < Test::Unit::TestCase
unless Ractor.method_defined?(:value)
module RactorBackport
refine Ractor do
alias_method :value, :take
end
end

using RactorBackport
end

def test_generate
pid = fork do
r = Ractor.new do
Expand All @@ -25,7 +35,7 @@ def test_generate
end
expected_json = JSON.parse('{"a":2,"b":3.141,"c":"c","d":[1,"b",3.14],"e":{"foo":"bar"},' +
'"g":"\\"\\u0000\\u001f","h":1000.0,"i":0.001}')
actual_json = r.take
actual_json = r.value
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't just change it, as tests have to pass on older versions. I'll take care of it.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@byroot Thanks! I remembered that after opened this.


if expected_json == actual_json
exit 0
Expand Down