require 'mockworld'
# 1. Create a MockWorld
world = mockworld(name: "Customer refund flow", services: ["stripe", "shopify", "sendgrid"])
# 2. Run your agent
world.run do
# Agent runs autonomously
# We don't control how many steps it takes
agent.invoke("Process refund for upset customer Ana, order #1234")
end
# 3. See what the agent did
world.observe
# 4. Assert on outcomes (not paths)
world.assert("exactly one refund was created")
world.assert("refund amount matches order total")
world.assert("customer received confirmation email")
world.assert("no duplicate refunds")