Skip to content

Commit

Permalink
made Task#tag? case insensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Ström committed Feb 3, 2010
1 parent 62b658d commit 935a77d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/things/task.rb
Expand Up @@ -48,7 +48,7 @@ def tags?
end

def tag?(name)
tags.include?(name)
tags.any? { |t| t.casecmp(name) == 0 }
end

def parent_id
Expand Down
6 changes: 6 additions & 0 deletions test/test_task.rb
Expand Up @@ -67,6 +67,12 @@ def task_by_id(id)
assert(!task.tag?("Errand"))
end

test "if the task has a specific tag in other case" do
task = find_task(:with_tags)
assert task.tag?("HOME")
assert !task.tag?("errand")
end

test "should find the tasks parent_id" do
task = find_task(:with_parent)
assert_equal("z154", task.parent_id)
Expand Down

0 comments on commit 935a77d

Please sign in to comment.