describe Order do before do order.add_entry(LineItem.new(:item => Item.new( :price => Money.new(1.11, :USD) ))) end let(order) { Order.new } it "sums the prices of its line items" do order.add_entry(LineItem.new(:item => Item.new( :price => Money.new(2.22, :USD), :quantity => 2 ))) expect(order.total).to eq(Money.new(5.55, :USD)) end end Rspecはrspec-core, rspec-expectations, rspec-mocksの3つにわかれており、