Skip to content

Commit

Permalink
update spec for ubuntu-latest; no need of log file with newer aruba
Browse files Browse the repository at this point in the history
  • Loading branch information
wtsnjp committed Apr 26, 2021
1 parent c6fc2ae commit f9decd1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 32 deletions.
9 changes: 1 addition & 8 deletions Rakefile
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion spec/config/environment_variables_spec.rb
Expand Up @@ -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
Expand Down
23 changes: 0 additions & 23 deletions spec/support/helpers/texdoc.rb
Expand Up @@ -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

0 comments on commit f9decd1

Please sign in to comment.