diff options
author | Benoit Daloze <eregontp@gmail.com> | 2022-12-20 17:59:46 +0100 |
---|---|---|
committer | Benoit Daloze <eregontp@gmail.com> | 2022-12-20 19:32:23 +0100 |
commit | 45175962a6fd74ab2e9ba92f1280f3987af25494 (patch) | |
tree | 7a4fcccfd76b12ffdc853a93822ba74b56b4e6e6 /spec/ruby | |
parent | 88040063d0ec8aa64e0de2a3afae7286ec53bfdb (diff) | |
download | ruby-45175962a6fd74ab2e9ba92f1280f3987af25494.tar.gz |
Never use the storage of another Fiber, that violates the whole design
* See https://bugs.ruby-lang.org/issues/19078#note-30
Diffstat (limited to 'spec/ruby')
-rw-r--r-- | spec/ruby/core/fiber/storage_spec.rb | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/spec/ruby/core/fiber/storage_spec.rb b/spec/ruby/core/fiber/storage_spec.rb index 4adfd30d2b..c0958d98ee 100644 --- a/spec/ruby/core/fiber/storage_spec.rb +++ b/spec/ruby/core/fiber/storage_spec.rb @@ -22,14 +22,6 @@ describe "Fiber.new(storage:)" do fiber.resume.should == {life: 42} end - it "creates a fiber with a reference to the storage of the parent fiber" do - fiber = Fiber.new(storage: {life: 42}) do - Fiber.new(storage: false) { Fiber[:life] = 43 }.resume - Fiber.current.storage - end - fiber.resume.should == {life: 43} - end - it "cannot create a fiber with non-hash storage" do -> { Fiber.new(storage: 42) {} }.should raise_error(TypeError) end |