File: clone_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 (28 lines) | stat: -rw-r--r-- 643 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
RSpec.describe Magick::Image, "#clone" do
  it "returns a new copy of the image" do
    image = build_image

    new_image = image.clone

    expect(new_image).to eq(image)
    expect(new_image).not_to be(image)
    expect(new_image.export_pixels).to eq(image.export_pixels)
  end

  it "returns a non-frozen copy of the image when it is not frozen" do
    image = build_image

    new_image = image.clone

    expect(new_image.frozen?).to be(false)
  end

  it "returns a frozen copy of the image when it is frozen" do
    image = build_image

    image.freeze
    new_image = image.clone

    expect(new_image.frozen?).to be(true)
  end
end