I copied and pasted the numeric string into irb and found where the 173 is coming from:
irb(main):001:0> a = '01500300200010090627
irb(main):002:0' 00684304900020175010
irb(main):003:0' 40380003905000900081
irb(main):004:0' 04086007002503720460
irb(main):005:0' 0'
=> "01500300200010090627\n 00684304900020175010\n 40380003905000900081\n 04086007002503720460\n 0"
irb(main):006:0> a.length
=> 173
As you can see it is including the newlines and spaces. You probably want this:
let(:puzzle) { '01500300200010090627' +
'00684304900020175010' +
'40380003905000900081' +
'04086007002503720460' +
'0' }
Regarding @rows
I am guessing you want
@rows = @cells.each_slice(9).to_a
but in your test you should have
expect(grid.rows.size).to eq(9)