summaryrefslogtreecommitdiff
path: root/test/rubygems/test_gem_ext_rake_builder.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/rubygems/test_gem_ext_rake_builder.rb')
-rw-r--r--test/rubygems/test_gem_ext_rake_builder.rb23
1 files changed, 12 insertions, 11 deletions
diff --git a/test/rubygems/test_gem_ext_rake_builder.rb b/test/rubygems/test_gem_ext_rake_builder.rb
index 3ed818a7f8..bd72c1aa08 100644
--- a/test/rubygems/test_gem_ext_rake_builder.rb
+++ b/test/rubygems/test_gem_ext_rake_builder.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require_relative "helper"
require "rubygems/ext"
@@ -22,9 +23,9 @@ class TestGemExtRakeBuilder < Gem::TestCase
output = output.join "\n"
- refute_match %r{^rake failed:}, output
- assert_match %r{^#{Regexp.escape Gem.ruby} mkrf_conf\.rb}, output
- assert_match %r{^#{Regexp.escape rake} RUBYARCHDIR\\=#{Regexp.escape @dest_path} RUBYLIBDIR\\=#{Regexp.escape @dest_path}}, output
+ refute_match(/^rake failed:/, output)
+ assert_match(/^#{Regexp.escape Gem.ruby} mkrf_conf\.rb/, output)
+ assert_match(/^#{Regexp.escape rake} RUBYARCHDIR\\=#{Regexp.escape @dest_path} RUBYLIBDIR\\=#{Regexp.escape @dest_path}/, output)
end
end
@@ -41,9 +42,9 @@ class TestGemExtRakeBuilder < Gem::TestCase
output = output.join "\n"
- refute_match %r{^rake failed:}, output
- assert_match %r{^#{Regexp.escape Gem.ruby} mkrf_conf\.rb}, output
- assert_match %r{^#{Regexp.escape rake} RUBYARCHDIR\\=#{Regexp.escape @dest_path} RUBYLIBDIR\\=#{Regexp.escape @dest_path}}, output
+ refute_match(/^rake failed:/, output)
+ assert_match(/^#{Regexp.escape Gem.ruby} mkrf_conf\.rb/, output)
+ assert_match(/^#{Regexp.escape rake} RUBYARCHDIR\\=#{Regexp.escape @dest_path} RUBYLIBDIR\\=#{Regexp.escape @dest_path}/, output)
end
end
@@ -71,7 +72,7 @@ class TestGemExtRakeBuilder < Gem::TestCase
output = output.join "\n"
assert_match "OpenSSL", output
- assert_match %r{^#{Regexp.escape Gem.ruby} mkrf_conf\.rb}, output
+ assert_match(/^#{Regexp.escape Gem.ruby} mkrf_conf\.rb/, output)
end
def test_class_build_no_mkrf_passes_args
@@ -82,8 +83,8 @@ class TestGemExtRakeBuilder < Gem::TestCase
output = output.join "\n"
- refute_match %r{^rake failed:}, output
- assert_match %r{^#{Regexp.escape rake} RUBYARCHDIR\\=#{Regexp.escape @dest_path} RUBYLIBDIR\\=#{Regexp.escape @dest_path} test1 test2}, output
+ refute_match(/^rake failed:/, output)
+ assert_match(/^#{Regexp.escape rake} RUBYARCHDIR\\=#{Regexp.escape @dest_path} RUBYLIBDIR\\=#{Regexp.escape @dest_path} test1 test2/, output)
end
end
@@ -91,12 +92,12 @@ class TestGemExtRakeBuilder < Gem::TestCase
create_temp_mkrf_file("task :default do abort 'fail' end")
output = []
- build_rake_in(false) do |rake|
+ build_rake_in(false) do |_rake|
error = assert_raise Gem::InstallError do
Gem::Ext::RakeBuilder.build "mkrf_conf.rb", @dest_path, output, [], nil, @ext
end
- assert_match %r{^rake failed}, error.message
+ assert_match(/^rake failed/, error.message)
end
end