require'./app/neighborhood.rb'describeNeighborhooddolet(:alive){[1,1,1,0,0,0,0,0,0]}describe'#next_state'doit'returns 1 when it will be alive'doneighborhood=Neighborhood.new(alive)expect(neighborhood.next_state).toeq1endendend

require'./app/neighborhood.rb'describeNeighborhooddolet(:alive){[1,1,1,0,0,0,0,0,0]}let(:dead){[0,0,1,0,0,0,0,0,0]}let(:dead2){[1,1,1,1,1,1,1,1,1]}let(:dead3){[0,0,0,0,0,0,0,0,0]}describe'#next_state'do...it'returns 0 when it will be dead'do[dead,dead2,dead3].eachdo|cells|neighborhood=Neighborhood.new(cells)expect(neighborhood.next_state).toeq0endend

require'./app/neighborhood.rb'describeNeighborhooddo...let(:status_quo1){[1,1,1,1,0,0,0,0,0]}let(:status_quo2){[0,1,1,1,1,0,0,0,0]}describe'#next_state'do...it'returns old state in other cases'doneighborhood=Neighborhood.new(status_quo1)expect(neighborhood.next_state).toeq0neighborhood=Neighborhood.new(status_quo2)expect(neighborhood.next_state).toeq1endendend