1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Add specs for [Feature #13983] Rational and Complex should be frozen

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60505 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
eregon 2017-10-28 10:32:45 +00:00
parent 9c4542dbaa
commit 662fb599b0
3 changed files with 68 additions and 0 deletions

View file

@ -49,4 +49,30 @@ describe "Kernel#frozen?" do
@symbol.frozen?.should be_true
end
end
ruby_version_is "2.5" do
describe "on a Complex" do
it "returns true" do
c = Complex(1.3, 3.1)
c.frozen?.should be_true
end
it "literal returns true" do
c = eval "1.3i"
c.frozen?.should be_true
end
end
describe "on a Rational" do
it "returns true" do
r = Rational(1, 3)
r.frozen?.should be_true
end
it "literal returns true" do
r = eval "1/3r"
r.frozen?.should be_true
end
end
end
end