summaryrefslogtreecommitdiff
path: root/test/rubygems/test_gem_commands_unpack_command.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/rubygems/test_gem_commands_unpack_command.rb')
-rw-r--r--test/rubygems/test_gem_commands_unpack_command.rb22
1 files changed, 20 insertions, 2 deletions
diff --git a/test/rubygems/test_gem_commands_unpack_command.rb b/test/rubygems/test_gem_commands_unpack_command.rb
index ff3d4e0eae..427f9403c3 100644
--- a/test/rubygems/test_gem_commands_unpack_command.rb
+++ b/test/rubygems/test_gem_commands_unpack_command.rb
@@ -7,7 +7,9 @@ class TestGemCommandsUnpackCommand < RubyGemTestCase
def setup
super
- @cmd = Gem::Commands::UnpackCommand.new
+ Dir.chdir @tempdir do
+ @cmd = Gem::Commands::UnpackCommand.new
+ end
end
def test_execute
@@ -15,13 +17,29 @@ class TestGemCommandsUnpackCommand < RubyGemTestCase
@cmd.options[:args] = %w[a]
+ use_ui @ui do
+ Dir.chdir @tempdir do
+ @cmd.execute
+ end
+ end
+
+ assert File.exist?(File.join(@tempdir, 'a-2'))
+ end
+
+ def test_execute_with_target_option
+ util_make_gems
+
+ target = 'with_target'
+ @cmd.options[:args] = %w[a]
+ @cmd.options[:target] = target
+
use_ui @ui do
Dir.chdir @tempdir do
@cmd.execute
end
end
- assert File.exist?(File.join(@tempdir, 'a-0.0.2'))
+ assert File.exist?(File.join(@tempdir, target, 'a-2'))
end
def test_execute_exact_match