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 (17 lines) | stat: -rw-r--r-- 633 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
RSpec.describe Magick::Image, "#spaceship" do
  it "works" do
    image0 = described_class.read(IMAGES_DIR + '/Button_0.gif').first
    image1 = described_class.read(IMAGES_DIR + '/Button_1.gif').first
    sig0 = image0.signature
    sig1 = image1.signature

    # since <=> is based on the signature, the images should
    # have the same relationship to each other as their
    # signatures have to each other.
    expect(image0 <=> image1).to eq(sig0 <=> sig1)
    expect(image1 <=> image0).to eq(sig1 <=> sig0)
    expect(image0).to eq(image0)
    expect(image1).not_to eq(image0)
    expect(image0 <=> nil).to be(nil)
  end
end