Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add specs to cover the fix for [Bug #14266] #858

Merged
merged 3 commits into from
Oct 16, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions library/set/clone_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
require_relative '../../spec_helper'
require 'set'

describe "Set#clone" do
ruby_version_is "3.0" do
it "does not freeze the new Set" do
wenderjean marked this conversation as resolved.
Show resolved Hide resolved
set1 = Set[1, 2]
set1.freeze
set2 = set1.clone(freeze: false)
set1.frozen?.should == true
set2.frozen?.should == false
set2.add 3
set1.should == Set[1, 2]
set2.should == Set[1, 2, 3]
end
end
end