TheOdinProject / ruby-exercises

MIT License
219 stars 1.07k forks source link

Update instructions: find_low_inventory returns a hash, not an array #29

Closed kellydanma closed 3 years ago

kellydanma commented 3 years ago

I noticed that the commented instructions for the method find_low_inventory in 9: Basic Enumerables encourage the student to "return an array of list items with values less than 4".

However, the rspec file is testing this method for a hash, not an array. For example:

describe 'find low inventory exercise' do

  it 'returns a hash with integer values' do
    fruit = {apples: 1, peaches: 4, bananas: 3, oranges: 7}
    result = {apples: 1, bananas: 3}
    expect(find_low_inventory(fruit)).to eq(result)
  end

end

It would make it more clear for future students if we changed the instructions, as I have done so in this PR. Personally, at first, I thought that we were only supposed to return an array of the keys!

kellydanma commented 3 years ago

I could not find repo-specific contributing guidelines; please let me know if there is anything I should take a look at!

rlmoser99 commented 3 years ago

@kellydanma Great catch! Thanks for taking the time to make this change.