Skip to content

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

@mtasaka

Description

@mtasaka

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions