turingschool-examples / ruby-exercises

A collection of exercises to practice various aspects of Ruby
MIT License
237 stars 766 forks source link

`encounter_counter` class instance method belongs to two different classes in `mythical-creatures/spec/ogre_spec.rb` on lines 28 and 82 #133

Closed brandenge closed 1 year ago

brandenge commented 1 year ago

The encounter_counter class instance method belongs to both the Ogre and Human class, according to the tests

Line 28: expect(human.encounter_counter).to eq(1)

Line 82: expect(ogre.encounter_counter).to eq(6)

While I guess in theory it could belong to both classes, I don't think that makes much sense. Instead, I think the intent here is for it to belong to the Human class only, which would make more sense than having it belong to the Ogre class only.

If that is the case, then line 82 can be changed to: expect(human.encounter_counter).to eq(6)

epintozzi commented 1 year ago

I'm going to dig a little deeper into this one to make sure that isn't intentional.

epintozzi commented 1 year ago

Ah I see what you're saying now. Yep that makes sense. Good catch!