Sha256: b3259221ac5cd7f93d403316d84c310211e62186ac595a6f691176c0af56e783

Contents?: true

Size: 741 Bytes

Versions: 17

Compression:

Stored size: 741 Bytes

Contents

# encoding: utf-8
require File.expand_path('../test_helper', __FILE__)
require 'task_list'
require 'task_list/filter'

class TaskListTest < Minitest::Test
  class Record < Struct.new(:body)
    def task_list_items
      []
    end
  end

  def test_has_summary
    assert summary = task_list("- [ ] one").summary, "summary expected"
    assert_kind_of TaskList::Summary, summary
  end

  def test_complete_item
    item = TaskList::Item.new("[x]", "complete")
    assert item.complete?, "expected to be complete"
  end

  def test_incomplete_item
    item = TaskList::Item.new("[ ]", "incomplete")
    assert !item.complete?, "expected to be incomplete"
  end

  protected

  def task_list(text)
    TaskList.new(Record.new(text))
  end
end

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
deckar01-task_list-2.3.4 test/task_list_test.rb
deckar01-task_list-2.3.3 test/task_list_test.rb
deckar01-task_list-3.0.alpha2 test/task_list_test.rb
deckar01-task_list-3.0.alpha1 test/task_list_test.rb
deckar01-task_list-2.3.2 test/task_list_test.rb
deckar01-task_list-2.3.1 test/task_list_test.rb
deckar01-task_list-2.3.0 test/task_list_test.rb
deckar01-task_list-2.2.1 test/task_list_test.rb
deckar01-task_list-2.2.0 test/task_list_test.rb
deckar01-task_list-2.1.0 test/task_list_test.rb
deckar01-task_list-2.0.1 test/task_list_test.rb
deckar01-task_list-2.0.0 test/task_list_test.rb
deckar01-task_list-1.0.6 test/task_list_test.rb
deckar01-task_list-1.0.5 test/task_list_test.rb
deckar01-task_list-1.0.4 test/task_list_test.rb
deckar01-task_list-1.0.3 test/task_list_test.rb
task_list-1.0.2 test/task_list_test.rb