Sha256: 93b8635148c97581f60cd54847ea4cc84c26fe610d87bda9ee7ce9eebdd5e460

Contents?: true

Size: 779 Bytes

Versions: 5

Compression:

Stored size: 779 Bytes

Contents

# coding: utf-8

require 'test_helper'

class Thinreports::Core::Shape::TextBlock::TestFormatter < Minitest::Test
  include Thinreports::TestHelper

  # Alias
  Formatter = Thinreports::Core::Shape::TextBlock::Formatter

  def test_initialize_formatter_by_type
    assert_instance_of Formatter::Basic,
      Formatter.setup( stub(format_type: '') )

    assert_instance_of Formatter::Number,
      Formatter.setup( stub(format_type: 'number') )

    assert_instance_of Formatter::Datetime,
      Formatter.setup( stub(format_type: 'datetime') )

    assert_instance_of Formatter::Padding,
      Formatter.setup( stub(format_type: 'padding') )

    assert_raises Thinreports::Errors::UnknownFormatterType do
      Formatter.setup( stub(format_type: 'unknown') )
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
thinreports-0.9.1 test/unit/core/shape/text_block/test_formatter.rb
thinreports-0.9.0 test/unit/core/shape/text_block/test_formatter.rb
thinreports-0.8.2 test/unit/core/shape/text_block/test_formatter.rb
thinreports-0.8.1 test/unit/core/shape/text_block/test_formatter.rb
thinreports-0.8.0 test/unit/core/shape/text_block/test_formatter.rb