Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spec test suite of chunky_png 1.4.0 fails with upcoming ruby32 due to Object#:~ removal #168

Open
mtasaka opened this issue Nov 15, 2022 · 0 comments · May be fixed by #169
Open

spec test suite of chunky_png 1.4.0 fails with upcoming ruby32 due to Object#:~ removal #168

mtasaka opened this issue Nov 15, 2022 · 0 comments · May be fixed by #169

Comments

@mtasaka
Copy link

mtasaka commented Nov 15, 2022

Fedora project is now preparing for upcoming ruby3.2 (which is expected to be released on 2022/Dec) and with ruby3.2dev, chunky_png 1.4.0 spec testsuite fails like below:

Failures:

  1) ChunkyPNG::Canvas::Drawing#polygon should draw an filled triangle when using 3 control points
     Failure/Error: if source.first.is_a?(Numeric) || source.first =~ /^\d+$/

     NoMethodError:
       undefined method `=~' for ["2", "2"]:Array
     # ./lib/chunky_png/vector.rb:169:in `multiple_from_array'
     # ./lib/chunky_png/vector.rb:182:in `multiple_from_string'
     # ./lib/chunky_png/vector.rb:24:in `Vector'
     # ./lib/chunky_png/canvas/drawing.rb:167:in `polygon'
     # ./spec/chunky_png/canvas/drawing_spec.rb:108:in `block (3 levels) in <top (required)>'

  2) ChunkyPNG::Canvas::Drawing#polygon should draw a unfilled polygon with 6 control points
     Failure/Error: if source.first.is_a?(Numeric) || source.first =~ /^\d+$/

     NoMethodError:
       undefined method `=~' for ["2", "2"]:Array
     # ./lib/chunky_png/vector.rb:169:in `multiple_from_array'
     # ./lib/chunky_png/vector.rb:182:in `multiple_from_string'
     # ./lib/chunky_png/vector.rb:24:in `Vector'
     # ./lib/chunky_png/canvas/drawing.rb:167:in `polygon'
     # ./spec/chunky_png/canvas/drawing_spec.rb:113:in `block (3 levels) in <top (required)>'

( and similar failures follow)

Finished in 0.5954 seconds (files took 0.13387 seconds to load)
461 examples, 16 failures

Failed examples:

rspec ./spec/chunky_png/canvas/drawing_spec.rb:107 # ChunkyPNG::Canvas::Drawing#polygon should draw an filled triangle when using 3 control points
rspec ./spec/chunky_png/canvas/drawing_spec.rb:112 # ChunkyPNG::Canvas::Drawing#polygon should draw a unfilled polygon with 6 control points
rspec ./spec/chunky_png/canvas/drawing_spec.rb:117 # ChunkyPNG::Canvas::Drawing#polygon should draw a vertically crossed filled polygon with 4 control points
rspec ./spec/chunky_png/canvas/drawing_spec.rb:122 # ChunkyPNG::Canvas::Drawing#polygon should draw a vertically crossed filled polygon with 4 control points
rspec ./spec/chunky_png/canvas/drawing_spec.rb:127 # ChunkyPNG::Canvas::Drawing#polygon should return itself to allow chaining
rspec ./spec/chunky_png/canvas/drawing_spec.rb:135 # ChunkyPNG::Canvas::Drawing#bezier_curve should draw a bezier curve starting at the first point
rspec ./spec/chunky_png/canvas/drawing_spec.rb:140 # ChunkyPNG::Canvas::Drawing#bezier_curve should draw a bezier curve ending at the last point
rspec ./spec/chunky_png/canvas/drawing_spec.rb:145 # ChunkyPNG::Canvas::Drawing#bezier_curve should draw a bezier curve with a color of green
rspec ./spec/chunky_png/canvas/drawing_spec.rb:150 # ChunkyPNG::Canvas::Drawing#bezier_curve should draw a three point bezier curve
rspec ./spec/chunky_png/canvas/drawing_spec.rb:154 # ChunkyPNG::Canvas::Drawing#bezier_curve should draw a three point bezier curve flipped
rspec ./spec/chunky_png/canvas/drawing_spec.rb:158 # ChunkyPNG::Canvas::Drawing#bezier_curve should draw a four point bezier curve
rspec ./spec/chunky_png/canvas/drawing_spec.rb:162 # ChunkyPNG::Canvas::Drawing#bezier_curve should draw a four point bezier curve flipped
rspec ./spec/chunky_png/canvas/drawing_spec.rb:166 # ChunkyPNG::Canvas::Drawing#bezier_curve should draw a four point bezier curve with a shape of an s
rspec ./spec/chunky_png/canvas/drawing_spec.rb:170 # ChunkyPNG::Canvas::Drawing#bezier_curve should draw a five point bezier curve
rspec ./spec/chunky_png/canvas/drawing_spec.rb:174 # ChunkyPNG::Canvas::Drawing#bezier_curve should draw a six point bezier curve
rspec ./spec/chunky_png/vector_spec.rb:102 # ChunkyPNG.Vector should create a vector from a string

Object#:~ has been deprecated since ruby2.6 and will be removed from ruby3.2:
https://github.com/ruby/ruby/blob/d15d1c01c28f63888475f8016adbc8b4f982b573/NEWS.md?plain=1#L288

mtasaka added a commit to mtasaka/chunky_png that referenced this issue Nov 15, 2022
Object#=~ is already deprecated since ruby2.6 and will be
removed from ruby3.2. As the result, Array no longer
respond to =~ from ruby3.2, for example.

Check if the target object really respond to =~ .

Closes wvanbergen#168
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant