Sha256: 9957556780e4e0081a585d8ca0c21eae72c07df24061cc1a3f93c2074832d0ce
Contents?: true
Size: 1.88 KB
Versions: 4
Compression:
Stored size: 1.88 KB
Contents
# frozen_string_literal: true require 'test_helper' class Thinreports::Core::Shape::List::TestManager < Minitest::Test include Thinreports::TestHelper # Alias List = Thinreports::Core::Shape::List def create_report(&block) report = Thinreports::Report.new layout: layout_file.path block.call(report) if block_given? report end def list_manager report = create_report {|r| r.start_new_page } report.page.list.manager end def test_current_page_should_return_the_instance_of_ListPage assert_instance_of List::Page, list_manager.current_page end def test_current_page_state_should_return_the_instance_of_ListPageState assert_instance_of List::PageState, list_manager.current_page_state end def test_switch_current_should_replace_own_current_page_property_by_the_given_page report = create_report {|r| r.start_new_page } list = report.page.list new_page = List::Page.new(report.page, list.internal.format) list.manager.switch_current!(new_page) assert_same list.manager.current_page, new_page end def test_switch_current_should_replace_own_current_page_state_property_by_internal_property_of_the_given_page report = create_report {|r| r.start_new_page } list = report.page.list new_page = List::Page.new(report.page, list.internal.format) list.manager.switch_current!(new_page) assert_same list.manager.current_page_state, new_page.internal end def test_switch_current_should_return_the_self report = create_report {|r| r.start_new_page } list = report.page.list new_page = List::Page.new(report.page, list.internal.format) assert_same list.manager.switch_current!(new_page), list.manager end def test_page_count report = create_report assert_equal report.page_count, 0 report.list.page_break report.list.page_break assert_equal report.list.manager.page_count, 2 end end
Version data entries
4 entries across 4 versions & 1 rubygems