title: How do you return a name from an array of hashes Ruby TDD
body: <p>First I am new to programing and here is the issue </p>
  
  <p>This is the spec</p>
  
  <pre><code>require 'minitest/autorun'
  require_relative '../pet_shop'
  
  class TestPetShop &lt; Minitest::Test
    def setup
      @customers = [{
        name: "Craig",
        pets: [],
        cash: 1000
      }, {
        name: "Zsolt",
        pets: [],
        cash: 50
      }]
  
      @new_pet = {
        name: "Bors the Younger",
        pet_type: :cat,
        breed: "Cornish Rex",
        price: 100
      }
  
      @pet_shop = {
        pets: [{
          name: "Sir Percy",
          pet_type: :cat,
          breed: "British Shorthair",
          price: 500
        }, {
          name: "King Bagdemagus",
          pet_type: :cat,
          breed: "British Shorthair",
          price: 500
        }, {
          name: "Sir Lancelot",
          pet_type: :dog,
          breed: "Pomsky",
          price: 1000,
        }, {
          name: "Arthur",
          pet_type: :dog,
          breed: "Husky",
          price: 900,
        }, {
          name: "Tristan",
          pet_type: :dog,
          breed: "Basset Hound",
          price: 800,
        }, {
          name: "Merlin",
          pet_type: :cat,
          breed: "Egyptian Mau",
          price: 1500,
        }],
        admin: {
          total_cash: 1000,
          pets_sold: 0,
        },
        name: "Camelot of Pets"
      }
    end
  
    def test_find_pet_by_name__returns_pet
      pet = find_pet_by_name(@pet_shop, "Arthur")
      assert_equal("Arthur", pet[:name])
    end
  end
  </code></pre>
  
  <p>And here is my answer </p>
  
  <pre><code>  def find_pet_by_name(shop)
      pets = []
  
      for pet in shop[:pets]
        if pet[:name] == name
         return pet
        end
      end
  
      return pets 
    end
  </code></pre>
  
  <p>Keep getting wrong number of arguments error please remember i clearly don't know what i am doing as i am new programing.</p>