class TestPerson(unittest.TestCase): def setUp(self): self.person = Person(15, 60, 170) def it_gain_weight(self): self.person.gain_weight(5) self.person.weight |should| equal_to(65) def it_lose_weight(self): self.person.lose_weight(2) self.person.weight |should| equal_to(58) def it_get_old_6_years_and_check_its_height(self): self.person.get_old(6) self.person.height |should| equal_to(179) self.person.old |should| equal_to(21) def it_stop_to_get_height_at_21_years(self): self.person.get_old(10) self.person.height |should| equal_to(179) self.person.old |should| equal_to(25)
def setUp(self): self.person = Person(15, 60, 170)