Sha256: 95385bbea671892383e0da17747cee039bdba877ddc5c5f0df00a94386e699dc

Contents?: true

Size: 1.48 KB

Versions: 4

Compression:

Stored size: 1.48 KB

Contents

# frozen_string_literal: true

require 'test_helper'

class Thinreports::Core::TestShape < Minitest::Test
  include Thinreports::TestHelper

  # Alias
  ShapeModule = Thinreports::Core::Shape

  def test_find_by_type_should_return_PageNumber
    assert_same ShapeModule.find_by_type('page-number'), ShapeModule::PageNumber
  end

  def test_find_by_type_should_return_ImageBlock
    assert_same ShapeModule.find_by_type('image-block'), ShapeModule::ImageBlock
  end

  def test_find_by_type_should_return_TextBlock
    assert_same ShapeModule.find_by_type('text-block'), ShapeModule::TextBlock
  end

  def test_find_by_type_should_return_List
    assert_same ShapeModule.find_by_type('list'), ShapeModule::List
  end

  def test_find_by_type_should_return_Text
    assert_same ShapeModule.find_by_type('text'), ShapeModule::Text
  end

  def test_find_by_type_should_return_Basic_as_Image
    assert_same ShapeModule.find_by_type('image'), ShapeModule::Basic
  end

  def test_find_by_type_should_return_Basic_as_Line
    assert_same ShapeModule.find_by_type('line'), ShapeModule::Basic
  end

  def test_find_by_type_should_return_Basic_as_Rect
    assert_same ShapeModule.find_by_type('rect'), ShapeModule::Basic
  end

  def test_find_by_type_should_return_Basic_as_Ellipse
    assert_same ShapeModule.find_by_type('ellipse'), ShapeModule::Basic
  end

  def test_find_by_type_should_raise
    assert_raises Thinreports::Errors::UnknownShapeType do
      ShapeModule.find_by_type('unknown')
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
thinreports-0.10.3 test/units/core/test_shape.rb
thinreports-0.10.2 test/unit/core/test_shape.rb
thinreports-0.10.1 test/unit/core/test_shape.rb
thinreports-0.10.0 test/unit/core/test_shape.rb