From 821cc0867b88b5107b1831b42293d8a318e00423 Mon Sep 17 00:00:00 2001 From: Herwin Date: Sun, 27 Aug 2023 14:00:14 +0200 Subject: [PATCH] Add some tests for Fiber.new(storage:) These tests were present in the storage update tests, but were omitted in the create tests. --- core/fiber/storage_spec.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/fiber/storage_spec.rb b/core/fiber/storage_spec.rb index e99fe6e4d..06181b503 100644 --- a/core/fiber/storage_spec.rb +++ b/core/fiber/storage_spec.rb @@ -24,6 +24,14 @@ it "cannot create a fiber with non-hash storage" do -> { Fiber.new(storage: 42) {} }.should raise_error(TypeError) end + + it "cannot create a fiber with a frozen hash as storage" do + -> { Fiber.new(storage: {life: 43}.freeze) {} }.should raise_error(FrozenError) + end + + it "cannot create a fiber with a storage hash with non-symbol keys" do + -> { Fiber.new(storage: {life: 43, Object.new => 44}) {} }.should raise_error(TypeError) + end end end