Sha256: dc3c514d36c507400cd6fdac48a5c2317925f84c688233b5c01f407d7b3a469d

Contents?: true

Size: 1005 Bytes

Versions: 1

Compression:

Stored size: 1005 Bytes

Contents

# -*- coding: utf-8 -*-
require "sixarm_ruby_geometry_test"
require "sixarm_ruby_geometry/indexable/width_height"
require "sixarm_ruby_geometry_test/fake"

module Indexable
  class WidthHeightTest < Minitest::Test

    def test_0
      assert(::Indexable::WidthHeight)
    end

    require "matrix"
    class C < Vector
      include ::Indexable::WidthHeight
    end

    def test_width
      width = fake_n
      o = C[width,0]
      assert_equal(width, o.width)
    end

    def test_width_equal
      width = fake_n
      o = fake_indexable
      refute_equal(width, o.width)
      o.width = width
      assert_equal(width, o.width)
    end

    def test_height
      height = fake_n
      o = C[0,height]
      assert_equal(height, o.height)
    end

    def test_height_equal
      height = fake_n
      o = fake_indexable
      refute_equal(height, o.height)
      o.height = height
      assert_equal(height, o.height)
    end

    protected

    def fake_indexable
      C[0,0]
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sixarm_ruby_geometry-4.0.0 test/sixarm_ruby_geometry_test/indexable/width_height_test.rb