Heat 1 tbsp oil in a large non-stick frying pan over medium heat. Add onion and capsicum. Sauté until softened, about 5 minutes. Add pumpkin, half the salt, the basil and half the garlic. Cover; cook, stirring occasionally, 8 minutes. Increase heat to high. Cook, uncovered, stirring occasionally, until the vegetables brown slightly and pumpkin is just tender, about 7 minutes. Transfer mixture to a large bowl. Add tomato.
Heat remaining oil in the pan over medium heat. Add the remaining garlic and salt and all of the spinach. Cook, stirring occasionally, until spinach wilts, about 2 minutes. Add spinach to the mixture in the bowl.
Meanwhile, bring the stock and 2 cups water to the boil in a large saucepan. Add pasta. Cook until al dente, following packet instructions. Reserve ½ cup (125 ml) of the cooking liquid. Drain pasta and combine with vegetable mixture and reserved cooking liquid.