1
0
working_class/test/task_test.rb

26 lines
593 B
Ruby
Raw Normal View History

2015-02-25 08:52:38 +01:00
require File.expand_path('../test_helper.rb', __FILE__)
class TaskTest < Minitest::Test
include WorkingClass
def test_initialize
task = Task.new(true, "Hello World")
2015-02-25 15:18:30 +01:00
assert(task.is_finished?)
assert_equal("Hello World", task.name)
assert(!task.has_reminder?)
assert_nil(task.reminder)
2015-02-25 15:18:30 +01:00
end
def test_initialize_with_reminder
task = Task.new(false, "Good Morning", Time.new(2016, 10, 5))
2015-02-25 15:18:30 +01:00
assert(!task.is_finished)
assert_equal("Good Morning", task.name)
assert(task.has_reminder)
assert_equal(Time.new(2016, 10, 5), task.reminder)
2015-02-25 08:52:38 +01:00
end
end