Sha256: 32d85e63f3eae5d706b87d29c0315736c099aead00814ef781bf2abe7d617a0c

Contents?: true

Size: 964 Bytes

Versions: 4

Compression:

Stored size: 964 Bytes

Contents

# frozen_string_literal: true

require File.expand_path('../../../test_helper', __dir__)

class HTML::Pipeline::TaskList::SummaryTest < Minitest::Test
  def setup
    @complete   = make_item '[x]', 'complete'
    @incomplete = make_item '[ ]', 'incomplete'
    @items = [@complete, @incomplete]
    @summary = make_summary @items
  end

  def test_no_items
    summary = make_summary []
    assert !summary.items?, 'no task list items are expected'
  end

  def test_items
    assert @summary.items?, 'task list items are expected'
    assert_equal 2, @summary.item_count
  end

  def test_complete_count
    assert_equal 1, @summary.complete_count
  end

  def test_incomplete_count
    assert_equal 1, @summary.incomplete_count
  end

  protected

  def make_item(checkbox_text = '[ ]', source = 'an item!')
    HTML::Pipeline::TaskList::Item.new(checkbox_text, source)
  end

  def make_summary(items)
    HTML::Pipeline::TaskList::Summary.new(items)
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
html-pipeline-task_list-0.1.0 test/html/pipeline/task_list/summary_test.rb
html-pipeline-task_list-0.0.3 test/html/pipeline/task_list/summary_test.rb
html-pipeline-task_list-0.0.2 test/html/pipeline/task_list/summary_test.rb
html-pipeline-task_list-0.0.1 test/html/pipeline/task_list/summary_test.rb