Skip to content

Commit

Permalink
Merge pull request #2235 from herwinw/queue_freeze
Browse files Browse the repository at this point in the history
Import upstream specs of Queue#freeze
  • Loading branch information
seven1m authored Sep 23, 2024
2 parents ded124a + 13ef30b commit 556eff8
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 23 deletions.
6 changes: 6 additions & 0 deletions spec/core/queue/freeze_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
require_relative '../../spec_helper'
require_relative '../../shared/queue/freeze'

describe "Queue#freeze" do
it_behaves_like :queue_freeze, :freeze, -> { Queue.new }
end
18 changes: 18 additions & 0 deletions spec/shared/queue/freeze.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
describe :queue_freeze, shared: true do
ruby_version_is ""..."3.3" do
it "can be frozen" do
queue = @object.call
queue.freeze
queue.should.frozen?
end
end

ruby_version_is "3.3" do
it "raises an exception when freezing" do
queue = @object.call
-> {
queue.freeze
}.should raise_error(TypeError, "cannot freeze #{queue}")
end
end
end
23 changes: 0 additions & 23 deletions test/natalie/queue_test.rb

This file was deleted.

0 comments on commit 556eff8

Please sign in to comment.