File: new_image_spec.rb

package info (click to toggle)
ruby-rmagick 6.0.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 8,232 kB
  • sloc: cpp: 19,563; ruby: 17,147; sh: 88; javascript: 36; makefile: 13
file content (18 lines) | stat: -rw-r--r-- 654 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
RSpec.describe Magick::ImageList, "#new_image" do
  it "works" do
    image_list = described_class.new

    image_list.new_image(20, 20)

    expect(image_list.length).to eq(1)
    expect(image_list.scene).to eq(0)
    image_list.new_image(20, 20, Magick::HatchFill.new(Magick::Pixel.from_color('black'), Magick::Pixel.from_color('white')))
    expect(image_list.length).to eq(2)
    expect(image_list.scene).to eq(1)
    image_list.new_image(20, 20) { |options| options.background_color = 'red' }
    expect(image_list.length).to eq(3)
    expect(image_list.scene).to eq(2)

    expect { image_list.new_image(20, 20, nil) }.not_to raise_error
  end
end