Sha256: 75b52edf44eeeb1e6d9b8760d6f17857369e8755b614baa0bb7a40b3c0594f9c

Contents?: true

Size: 724 Bytes

Versions: 1

Compression:

Stored size: 724 Bytes

Contents

# coding: utf-8

require 'test/unit/helper'

class ThinReports::Core::Shape::PageNumber::TestInterface < MiniTest::Unit::TestCase
  include ThinReports::TestHelpers

  PageNumber = ThinReports::Core::Shape::PageNumber

  def init_pageno(format = {})
    PageNumber::Interface.new(flexmock('parent'), PageNumber::Format.new(format))
  end

  def test_format
    pageno = init_pageno('format' => '{page}')

    assert_equal pageno.format, '{page}'
    pageno.format('{page} / {total}')
    assert_equal pageno.format, '{page} / {total}'
  end

  def test_reset_format
    pageno = init_pageno('format' => '{page}')

    pageno.format('-- {page} --')
    pageno.reset_format

    assert_equal pageno.format, '{page}'
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
thinreports-0.7.7 test/unit/core/shape/page_number/test_interface.rb