class TestPerson(unittest.TestCase): def setUp(self): self.a_person = Person(12, 50, 140) # People(age, weight, height in centimeters) def it_creates_a_person(self): self.a_person | should | be_instance_of(Person) def it_changes_the_weight_of_the_person(self): self.a_person.weight = 45 self.a_person.weight | should | be(45) self.a_person.weight = 55 self.a_person.weight | should | be(55) def it_ages_the_person(self): self.a_person.get_old(13) self.a_person.age | should | be(13) self.a_person.height | should | be(155) self.a_person.get_old(12) self.a_person.age | should | be(13) self.a_person.height | should | be(155)
def setUp(self): self.a_person = Person(12, 50, 140) # People(age, weight, height in centimeters)