Skip to content

Commit

Permalink
add spec for TRUE/FALSE/NIL constants that are no longer defined
Browse files Browse the repository at this point in the history
  • Loading branch information
lxxxvi committed Oct 5, 2021
1 parent 9631c5a commit 228976e
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions core/builtin_constants/builtin_constants_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,45 @@
end
end
end

describe "TRUE" do
ruby_version_is "3.0" do
it "raises NameError" do
-> { TRUE }.should raise_error(NameError, /uninitialized constant TRUE/)
end
end

ruby_version_is "2.7"..."3.0" do
it "is deprecated" do
-> { TRUE }.should complain(/constant ::TRUE is deprecated/)
end
end
end

describe "FALSE" do
ruby_version_is "3.0" do
it "raises NameError" do
-> { FALSE }.should raise_error(NameError, /uninitialized constant FALSE/)
end
end

ruby_version_is "2.7"..."3.0" do
it "is deprecated" do
-> { FALSE }.should complain(/constant ::FALSE is deprecated/)
end
end
end

describe "NIL" do
ruby_version_is "3.0" do
it "raises NameError" do
-> { NIL }.should raise_error(NameError, /uninitialized constant NIL/)
end
end

ruby_version_is "2.7"..."3.0" do
it "is deprecated" do
-> { NIL }.should complain(/constant ::NIL is deprecated/)
end
end
end

0 comments on commit 228976e

Please sign in to comment.