From f9decd1cf8c76f506423f365772d1f88138c03b0 Mon Sep 17 00:00:00 2001 From: Takuto ASAKURA Date: Mon, 26 Apr 2021 15:31:56 +0900 Subject: [PATCH] update spec for ubuntu-latest; no need of log file with newer aruba --- Rakefile | 9 +-------- spec/config/environment_variables_spec.rb | 3 ++- spec/support/helpers/texdoc.rb | 23 ----------------------- 3 files changed, 3 insertions(+), 32 deletions(-) diff --git a/Rakefile b/Rakefile index 98913e5..292d4d5 100644 --- a/Rakefile +++ b/Rakefile @@ -169,14 +169,7 @@ task :test => end # run rspec - begin - sh "bundle exec rspec" + opt_args + opt_files - rescue - # show outputs if failed - log_file = TMP_DIR / "rspec.log" - sh "cat #{log_file}", verbose: false - fail - end + sh "bundle exec rspec" + opt_args + opt_files # make sure to end this process exit 0 diff --git a/spec/config/environment_variables_spec.rb b/spec/config/environment_variables_spec.rb index 98bd151..e233fcd 100644 --- a/spec/config/environment_variables_spec.rb +++ b/spec/config/environment_variables_spec.rb @@ -175,8 +175,9 @@ def ignore_env_line(config, env) if OS.windows? # TODO: support locale on Windows else - context "LC_ALL" do + context "LC_ALL and LANG" do before(:each) { set_environment_variable "LC_ALL", "ja_JP.UTF-8" } + before(:each) { set_environment_variable "LANG", "ja_JP.UTF-8" } before(:each) { run_texdoc "-dconfig", "texlive-en" } it "should be effective" do diff --git a/spec/support/helpers/texdoc.rb b/spec/support/helpers/texdoc.rb index 48808f6..014a7e0 100644 --- a/spec/support/helpers/texdoc.rb +++ b/spec/support/helpers/texdoc.rb @@ -50,27 +50,4 @@ def set_default_env RSpec.configure do |config| config.include SpecHelplers::Texdoc config.before(:each) { set_default_env } - - # log - log_file = Pathname.pwd + "tmp/rspec.log" - - config.before(:suite) do - now = Time.now.strftime("%F %T") - File.open(log_file, "w") do |log| - log.puts("Outputs of failed commands (#{now})") - end - end - - config.after(:each) do |example| - if !example.exception.nil? - File.open(log_file, "a") do |log| - log.puts - log.puts last_command_started.commandline - log.puts "STDOUT" - log.puts last_command_started.stdout - log.puts "STDERR" - log.puts last_command_started.stderr - end - end - end end