Skip to content

Commit

Permalink
Change ruby version for Kernel#trust, #untrust and #untrusted
Browse files Browse the repository at this point in the history
  • Loading branch information
AI-Mozi committed May 17, 2023
1 parent 2275adc commit 35dc26c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
8 changes: 7 additions & 1 deletion core/kernel/trust_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
require_relative 'fixtures/classes'

describe "Kernel#trust" do
ruby_version_is ""..."3.0" do
ruby_version_is ""..."3.2" do
it "is a no-op" do
o = Object.new.untrust
o.should_not.untrusted?
Expand All @@ -17,4 +17,10 @@
}.should complain(/Object#trust is deprecated and will be removed in Ruby 3.2/, verbose: true)
end
end

ruby_version_is "3.2" do
it "has been removed" do
Object.new.should_not.respond_to?(:trust)
end
end
end
8 changes: 7 additions & 1 deletion core/kernel/untrust_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
require_relative 'fixtures/classes'

describe "Kernel#untrust" do
ruby_version_is ""..."3.0" do
ruby_version_is ""..."3.2" do
it "is a no-op" do
o = Object.new
o.untrust
Expand All @@ -16,4 +16,10 @@
}.should complain(/Object#untrust is deprecated and will be removed in Ruby 3.2/, verbose: true)
end
end

ruby_version_is "3.2" do
it "has been removed" do
Object.new.should_not.respond_to?(:untrust)
end
end
end
8 changes: 7 additions & 1 deletion core/kernel/untrusted_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
require_relative 'fixtures/classes'

describe "Kernel#untrusted?" do
ruby_version_is ""..."3.0" do
ruby_version_is ""..."3.2" do
it "is a no-op" do
o = mock('o')
o.should_not.untrusted?
Expand All @@ -17,4 +17,10 @@
}.should complain(/Object#untrusted\? is deprecated and will be removed in Ruby 3.2/, verbose: true)
end
end

ruby_version_is "3.2" do
it "has been removed" do
Object.new.should_not.respond_to?(:untrusted?)
end
end
end

0 comments on commit 35dc26c

Please sign in to comment.