summaryrefslogtreecommitdiff
path: root/test/rubygems/test_gem_ext_cmake_builder.rb
diff options
context:
space:
mode:
authorTakuya Noguchi <takninnovationresearch@gmail.com>2022-07-17 08:08:51 +0000
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2022-07-22 12:07:23 +0900
commitd7ffd3fea402239b16833cc434404a7af82d44f3 (patch)
tree9794942135111c36e6b6bce69e070ca556b89028 /test/rubygems/test_gem_ext_cmake_builder.rb
parent388c4e1076ac5a58d5008abc8e0a8d017698875a (diff)
RubyGems: Enable Style/StringLiterals cop
Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>
Diffstat (limited to 'test/rubygems/test_gem_ext_cmake_builder.rb')
-rw-r--r--test/rubygems/test_gem_ext_cmake_builder.rb30
1 files changed, 15 insertions, 15 deletions
diff --git a/test/rubygems/test_gem_ext_cmake_builder.rb b/test/rubygems/test_gem_ext_cmake_builder.rb
index b4d7cf2d30..ee84b8e728 100644
--- a/test/rubygems/test_gem_ext_cmake_builder.rb
+++ b/test/rubygems/test_gem_ext_cmake_builder.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-require_relative 'helper'
-require 'rubygems/ext'
+require_relative "helper"
+require "rubygems/ext"
class TestGemExtCmakeBuilder < Gem::TestCase
def setup
@@ -12,21 +12,21 @@ class TestGemExtCmakeBuilder < Gem::TestCase
require "open3"
begin
- _, status = Open3.capture2e('cmake')
- pend 'cmake not present' unless status.success?
+ _, status = Open3.capture2e("cmake")
+ pend "cmake not present" unless status.success?
rescue Errno::ENOENT
- pend 'cmake not present'
+ pend "cmake not present"
end
- @ext = File.join @tempdir, 'ext'
- @dest_path = File.join @tempdir, 'prefix'
+ @ext = File.join @tempdir, "ext"
+ @dest_path = File.join @tempdir, "prefix"
FileUtils.mkdir_p @ext
FileUtils.mkdir_p @dest_path
end
def test_self_build
- File.open File.join(@ext, 'CMakeLists.txt'), 'w' do |cmakelists|
+ File.open File.join(@ext, "CMakeLists.txt"), "w" do |cmakelists|
cmakelists.write <<-EO_CMAKE
cmake_minimum_required(VERSION 2.6)
project(self_build NONE)
@@ -34,7 +34,7 @@ install (FILES test.txt DESTINATION bin)
EO_CMAKE
end
- FileUtils.touch File.join(@ext, 'test.txt')
+ FileUtils.touch File.join(@ext, "test.txt")
output = []
@@ -44,8 +44,8 @@ install (FILES test.txt DESTINATION bin)
assert_match %r{^cmake \. -DCMAKE_INSTALL_PREFIX\\=#{Regexp.escape @dest_path}}, output
assert_match %r{#{Regexp.escape @ext}}, output
- assert_contains_make_command '', output
- assert_contains_make_command 'install', output
+ assert_contains_make_command "", output
+ assert_contains_make_command "install", output
assert_match %r{test\.txt}, output
end
@@ -60,14 +60,14 @@ install (FILES test.txt DESTINATION bin)
shell_error_msg = %r{(CMake Error: .*)}
- assert_match 'cmake failed', error.message
+ assert_match "cmake failed", error.message
assert_match %r{^cmake . -DCMAKE_INSTALL_PREFIX\\=#{Regexp.escape @dest_path}}, output
assert_match %r{#{shell_error_msg}}, output
end
def test_self_build_has_makefile
- File.open File.join(@ext, 'Makefile'), 'w' do |makefile|
+ File.open File.join(@ext, "Makefile"), "w" do |makefile|
makefile.puts "all:\n\t@echo ok\ninstall:\n\t@echo ok"
end
@@ -77,7 +77,7 @@ install (FILES test.txt DESTINATION bin)
output = output.join "\n"
- assert_contains_make_command '', output
- assert_contains_make_command 'install', output
+ assert_contains_make_command "", output
+ assert_contains_make_command "install", output
end
end