Preheat the oven to 400 degrees
Using a flame-proof casserole dish (or a large, deep frying pan), pour in the oil. Then, saute the onion, zucchini, eggplant, and pepper until tender.
Add the garlic and cook for one more minute.
Then add the pesto or sun-dried tomatoes and cook for another minute.
Add the tomatoes. Then, fill the can with water and dump that in as well. Pour in the pasta and bring to a boil. Stir constantly to avoid the pasta sticking. Then, cover with a lid or tin foil, or pour the mixture into a baking dish and bake for 20 minutes.
Remove the casserole from the oven and add the spinach, stirring it in. Once the spinach has been incorporated, sprinkle the cheese and pine nuts on top. Return the dish to the oven, uncovered, to cook until the pasta is tender (about 10 minutes).