Sha256: 450eba474d0dff46b5ff73e0ef5889f1a8d05b002338f2b179caffd4592a642b

Contents?: true

Size: 958 Bytes

Versions: 1

Compression:

Stored size: 958 Bytes

Contents

module Gollum
  module DescendantTree
    module TestHelpers
      module PageMockFactory
        def build_mock_pages
          pages_info = [
            ['current_page', 'current_page.md', 'Current Page'],
            ['current_page/child','child.md','Child'],
            ['current_page/child/grandchild','grandchild.md','Grandchild'],
            ['current_page/child/grandchild/greatgrandchild','greatgrandchild.md','GreatGrandchild'],
            ['current_page/child_sibling', 'childsibling.md', 'Child Sibling']
          ]
          pages = []
          pages_info.each do |page|
            pages << create_page(page)
          end
          pages
        end

        def create_page(page_config)
          page = double
          page.stub(:url_path).and_return(page_config[0])
          page.stub(:filename).and_return(page_config[1])
          page.stub(:title).and_return(page_config[2])
          page
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gollum-descendant_tree-0.0.1 spec/support/test_helpers.rb