realmente funcionando? describe "#add_item" do it 'contain 1 new item' do product = instance_double('Product', name: 'Notebook', price: 3000) item = instance_double('Item', product: product, quantity: 1) expect do cart.add_item(item) end.to change{ cart.items.length }.from(0).to(1) end end Teste escrito com a biblioteca Rspec