File: spaceship_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 (24 lines) | stat: -rw-r--r-- 831 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
RSpec.describe Magick::ImageList, '#<=>' do
  it 'works' do
    image_list1 = described_class.new(*FILES[0..9])
    image_list2 = image_list1.copy

    expect(image_list2.scene).to eq(image_list1.scene)
    expect(image_list2).to eq(image_list1)
    image_list2.scene = 0
    expect(image_list2).not_to eq(image_list1)
    image_list2 = image_list1.copy
    image_list2[9] = image_list2[0]
    expect(image_list2).not_to eq(image_list1)
    image_list2 = image_list1.copy
    image_list2 << image_list1[9]
    expect(image_list2).not_to eq(image_list1)

    expect(image_list1 <=> 2).to be(nil)
    image_list2 = described_class.new
    image_list3 = described_class.new
    expect(image_list2 <=> image_list1).to be(nil)
    expect(image_list1 <=> image_list2).to be(nil)
    expect(image_list3 <=> image_list2).to be 0
  end
end