@@ -125,8 +125,8 @@ def test_execute_all
125125 @cmd . execute
126126 end
127127
128- assert File . exist? ( gem_bin )
129- assert File . exist? ( gem_stub )
128+ assert_path_exist gem_bin
129+ assert_path_exist gem_stub
130130
131131 out = @ui . output . split "\n "
132132
@@ -537,8 +537,8 @@ def test_execute_only_executables
537537 @cmd . execute
538538 end
539539
540- assert File . exist? gem_exec
541- refute File . exist? gem_lib
540+ assert_path_exist gem_exec
541+ assert_path_not_exist gem_lib
542542 end
543543
544544 def test_execute_only_plugins
@@ -572,9 +572,9 @@ def test_execute_only_plugins
572572 @cmd . execute
573573 end
574574
575- refute File . exist? gem_exec
576- assert File . exist? gem_plugin
577- refute File . exist? gem_lib
575+ assert_path_not_exist gem_exec
576+ assert_path_exist gem_plugin
577+ assert_path_not_exist gem_lib
578578 end
579579
580580 def test_execute_bindir
@@ -606,8 +606,8 @@ def test_execute_bindir
606606 @cmd . execute
607607 end
608608
609- refute File . exist? gem_exec
610- assert File . exist? gem_bindir
609+ assert_path_not_exist gem_exec
610+ assert_path_exist gem_bindir
611611 end
612612
613613 def test_execute_unknown_gem_at_remote_source
@@ -659,6 +659,42 @@ def test_execute_default_gem
659659 refute_includes "ruby_executable_hooks" , File . read ( exe )
660660 end
661661
662+ def test_execute_default_gem_and_regular_gem
663+ a_default = new_default_spec ( "a" , "1.2.0" )
664+
665+ a = util_spec "a" do |s |
666+ s . extensions << "ext/a/extconf.rb"
667+ end
668+
669+ ext_path = File . join @tempdir , "ext" , "a" , "extconf.rb"
670+ write_file ext_path do |io |
671+ io . write <<-'RUBY'
672+ File.open "Makefile", "w" do |f|
673+ f.puts "clean:\n\techo cleaned\n"
674+ f.puts "all:\n\techo built\n"
675+ f.puts "install:\n\techo installed\n"
676+ end
677+ RUBY
678+ end
679+
680+ install_default_gems a_default
681+ install_gem a
682+
683+ # Remove the extension files for a
684+ FileUtils . rm_rf a . gem_build_complete_path
685+
686+ @cmd . options [ :args ] = %w[ a ]
687+
688+ use_ui @ui do
689+ @cmd . execute
690+ end
691+
692+ assert_includes @ui . output , "Restored #{ a . full_name } "
693+
694+ # Check extension files for a were restored
695+ assert_path_exist a . gem_build_complete_path
696+ end
697+
662698 def test_execute_multi_platform
663699 a = util_spec "a" do |s |
664700 s . extensions << "ext/a/extconf.rb"
0 commit comments