File: no_dump_with_each.rb

package info (click to toggle)
ruby-parallel 1.22.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 464 kB
  • sloc: ruby: 1,930; makefile: 4
file content (22 lines) | stat: -rw-r--r-- 309 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# frozen_string_literal: true
require './spec/cases/helper'

class NotDumpable
  def marshal_dump
    raise "NOOOO"
  end

  def to_s
    'not dumpable'
  end
end

Parallel.each([1]) do
  print 'no dump for result'
  NotDumpable.new
end

Parallel.each([NotDumpable.new]) do
  print 'no dump for each'
  1
end