Skip to content

Commit

Permalink
Add some tests for Fiber.new(storage:)
Browse files Browse the repository at this point in the history
These tests were present in the storage update tests, but were omitted
in the create tests.
  • Loading branch information
herwinw committed Aug 27, 2023
1 parent c037246 commit 821cc08
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions core/fiber/storage_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 821cc08

Please sign in to comment.