summaryrefslogtreecommitdiff
path: root/test/rubygems/test_gem_commands_setup_command.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/rubygems/test_gem_commands_setup_command.rb')
-rw-r--r--test/rubygems/test_gem_commands_setup_command.rb58
1 files changed, 21 insertions, 37 deletions
diff --git a/test/rubygems/test_gem_commands_setup_command.rb b/test/rubygems/test_gem_commands_setup_command.rb
index afdc5d0979..29850c9074 100644
--- a/test/rubygems/test_gem_commands_setup_command.rb
+++ b/test/rubygems/test_gem_commands_setup_command.rb
@@ -24,14 +24,15 @@ class TestGemCommandsSetupCommand < Gem::TestCase
lib/rubygems/test_case.rb
lib/rubygems/ssl_certs/rubygems.org/foo.pem
bundler/exe/bundle
+ bundler/exe/bundler
bundler/lib/bundler.rb
bundler/lib/bundler/b.rb
+ bundler/bin/bundler/man/bundle-b.1
bundler/lib/bundler/man/bundle-b.1.ronn
+ bundler/lib/bundler/man/gemfile.5
bundler/lib/bundler/man/gemfile.5.ronn
bundler/lib/bundler/templates/.circleci/config.yml
bundler/lib/bundler/templates/.travis.yml
- bundler/man/bundle-b.1
- bundler/man/gemfile.5
]
create_dummy_files(filelist)
@@ -41,7 +42,7 @@ class TestGemCommandsSetupCommand < Gem::TestCase
gemspec.name = "bundler"
gemspec.version = BUNDLER_VERS
gemspec.bindir = "exe"
- gemspec.executables = ["bundle"]
+ gemspec.executables = ["bundle", "bundler"]
File.open 'bundler/bundler.gemspec', 'w' do |io|
io.puts gemspec.to_ruby
@@ -135,6 +136,7 @@ class TestGemCommandsSetupCommand < Gem::TestCase
exec_line = out.shift until exec_line == "RubyGems installed the following executables:"
assert_equal "\t#{default_gem_bin_path}", out.shift
assert_equal "\t#{default_bundle_bin_path}", out.shift
+ assert_equal "\t#{default_bundler_bin_path}", out.shift
end
def test_env_shebang_flag
@@ -152,6 +154,7 @@ class TestGemCommandsSetupCommand < Gem::TestCase
bin_env = win_platform? ? "" : %w[/usr/bin/env /bin/env].find {|f| File.executable?(f) } + " "
assert_match %r{\A#!\s*#{bin_env}#{ruby_exec}}, File.read(default_gem_bin_path)
assert_match %r{\A#!\s*#{bin_env}#{ruby_exec}}, File.read(default_bundle_bin_path)
+ assert_match %r{\A#!\s*#{bin_env}#{ruby_exec}}, File.read(default_bundler_bin_path)
assert_match %r{\A#!\s*#{bin_env}#{ruby_exec}}, File.read(gem_bin_path)
end
@@ -160,16 +163,6 @@ class TestGemCommandsSetupCommand < Gem::TestCase
@cmd.files_in('lib').sort
end
- def test_bundler_man1_files_in
- assert_equal %w[bundle-b.1],
- @cmd.bundler_man1_files_in('bundler/man').sort
- end
-
- def test_bundler_man5_files_in
- assert_equal %w[gemfile.5],
- @cmd.bundler_man5_files_in('bundler/man').sort
- end
-
def test_install_lib
@cmd.extend FileUtils
@@ -187,19 +180,6 @@ class TestGemCommandsSetupCommand < Gem::TestCase
end
end
- def test_install_man
- @cmd.extend FileUtils
-
- Dir.mktmpdir 'man' do |dir|
- @cmd.install_man dir
-
- assert_path_exists File.join("#{dir}/man1", 'bundle-b.1')
- refute_path_exists File.join("#{dir}/man1", 'bundle-b.1.ronn')
- assert_path_exists File.join("#{dir}/man5", 'gemfile.5')
- refute_path_exists File.join("#{dir}/man5", 'gemfile.5.ronn')
- end
- end
-
def test_install_default_bundler_gem
@cmd.extend FileUtils
@@ -308,8 +288,8 @@ class TestGemCommandsSetupCommand < Gem::TestCase
gemfile_5_ronn = File.join man, 'man5', 'gemfile.5.ronn'
gemfile_5_txt = File.join man, 'man5', 'gemfile.5.txt'
- files_that_go = [bundle_b_1_txt, bundle_b_1_ronn, gemfile_5_txt, gemfile_5_ronn]
- files_that_stay = [ruby_1, bundle_b_1, gemfile_5]
+ files_that_go = [bundle_b_1, bundle_b_1_txt, bundle_b_1_ronn, gemfile_5, gemfile_5_txt, gemfile_5_ronn]
+ files_that_stay = [ruby_1]
create_dummy_files(files_that_go + files_that_stay)
@@ -326,22 +306,22 @@ class TestGemCommandsSetupCommand < Gem::TestCase
@cmd.options[:previous_version] = Gem::Version.new '2.0.2'
- File.open 'History.txt', 'w' do |io|
+ File.open 'CHANGELOG.md', 'w' do |io|
io.puts <<-HISTORY_TXT
-=== #{Gem::VERSION} / 2013-03-26
+# #{Gem::VERSION} / 2013-03-26
-* Bug fixes:
+## Bug fixes:
* Fixed release note display for LANG=C when installing rubygems
* π is tasty
-=== 2.0.2 / 2013-03-06
+# 2.0.2 / 2013-03-06
-* Bug fixes:
+## Bug fixes:
* Other bugs fixed
-=== 2.0.1 / 2013-03-05
+# 2.0.1 / 2013-03-05
-* Bug fixes:
+## Bug fixes:
* Yet more bugs fixed
HISTORY_TXT
end
@@ -351,9 +331,9 @@ class TestGemCommandsSetupCommand < Gem::TestCase
end
expected = <<-EXPECTED
-=== #{Gem::VERSION} / 2013-03-26
+# #{Gem::VERSION} / 2013-03-26
-* Bug fixes:
+## Bug fixes:
* Fixed release note display for LANG=C when installing rubygems
* π is tasty
@@ -410,4 +390,8 @@ class TestGemCommandsSetupCommand < Gem::TestCase
def default_bundle_bin_path
File.join @install_dir, 'bin', 'bundle'
end
+
+ def default_bundler_bin_path
+ File.join @install_dir, 'bin', 'bundler'
+ end
end unless Gem.java_platform?