Sha256: b8f3cac642e8c5672bbcdc3715a4e6bd663c5e00ecb0ba52705a910502469794
Contents?: true
Size: 906 Bytes
Versions: 31
Compression:
Stored size: 906 Bytes
Contents
# -*- encoding: utf-8 -*- require 'test_helper' require 'hexapdf/utils/graphics_helpers' describe HexaPDF::Utils::GraphicsHelpers do include HexaPDF::Utils::GraphicsHelpers describe "calculate_dimensions" do it "returns the requested dimensions if both are specified" do assert_equal([7, 8], calculate_dimensions(5, 6, rwidth: 7, rheight: 8)) end it "returns the requested width and an adjusted height" do assert_equal([10, 12], calculate_dimensions(5, 6, rwidth: 10)) end it "returns the requested height and an adjusted width" do assert_equal([10, 12], calculate_dimensions(5, 6, rheight: 12)) end end describe "point_on_line" do it "returns the correct point" do assert_equal([5, 5], point_on_line(0, 0, 10, 10, distance: Math.sqrt(50))) assert_equal([5, 5], point_on_line(10, 10, 0, 0, distance: Math.sqrt(50))) end end end
Version data entries
31 entries across 31 versions & 1 rubygems