asciidoctor / asciidoctor-pdf

:page_with_curl: Asciidoctor PDF: A native PDF converter for AsciiDoc based on Asciidoctor and Prawn, written entirely in Ruby.
https://docs.asciidoctor.org/pdf-converter/latest/
MIT License
1.14k stars 500 forks source link

rspec testsuite fails with latest ruby3.3.0dev due to NoMethodError msg change #2458

Closed mtasaka closed 10 months ago

mtasaka commented 10 months ago

With upcomming ruby 3.3.0dev (I tried: https://github.com/ruby/ruby/commit/5e5a8cf752af362c7dad40f6a0b7aa93e18c5bd0 ) asciidoctor-pdf git head ( https://github.com/asciidoctor/asciidoctor-pdf/commit/ff737e2cf3842630518c00f5318537b853432fdb ) testsuite fails like:

Failures:

  1) Asciidoctor::PDF::Converter#convert theme should log error with filename and reason if exception is thrown during theme compilation
     Failure/Error: (expect logger).to have_message expected
       expected ERROR message matching `(?-mix:because of NoMethodError undefined method `start_with\?' for 10:(Fixnum|Integer); reverting to default theme)' to have been logged, but got ERROR: could not locate or load the built-in pdf theme `/builddir/build/GIT/asciidoctor-pdf/spec/fixtures/invalid-theme.yml' because of NoMethodError undefined method `start_with?' for an instance of Integer; reverting to default theme
     # ./spec/spec_helper/matchers/log_message.rb:12:in `block (3 levels) in <top (required)>'
     # ./spec/spec_helper/matchers/have_message.rb:8:in `with_memory_logger'
     # ./spec/spec_helper/matchers/log_message.rb:9:in `block (2 levels) in <top (required)>'
     # ./spec/converter_spec.rb:351:in `block (4 levels) in <top (required)>'

Finished in 16 minutes 46 seconds (files took 3.32 seconds to load)
2173 examples, 1 failure

Failed examples:

rspec ./spec/converter_spec.rb:350 # Asciidoctor::PDF::Converter#convert theme should log error with filename and reason if exception is thrown during theme compilation

This is because of the following change: https://github.com/ruby/ruby/pull/6950 https://bugs.ruby-lang.org/issues/18285

ruby3.3 changes the error messages on NoMethodError to reduce CPU usage.