summaryrefslogtreecommitdiff
path: root/test/rubygems/test_deprecate.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/rubygems/test_deprecate.rb')
-rw-r--r--test/rubygems/test_deprecate.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/rubygems/test_deprecate.rb b/test/rubygems/test_deprecate.rb
index b92bd1c3da..f5cd83ee89 100644
--- a/test/rubygems/test_deprecate.rb
+++ b/test/rubygems/test_deprecate.rb
@@ -77,4 +77,22 @@ class TestDeprecate < Gem::TestCase
assert_match(/on or after 2099-03-01/, err)
end
+ def test_deprecate_command
+ require 'rubygems/command'
+ foo_command = Class.new(Gem::Command) do
+ extend Gem::Deprecate
+
+ deprecate_command(2099, 4)
+
+ def execute
+ puts "pew pew!"
+ end
+ end
+
+ Gem::Commands.send(:const_set, :FooCommand, foo_command)
+ assert Gem::Commands::FooCommand.new("foo").deprecated?
+ ensure
+ Gem::Commands.send(:remove_const, :FooCommand)
+ end
+
end