1Preheat the oven to 350 degrees. Lightly coat a 9-inch square cake pan with vegetable oil spray. Whisk the flour, spices, cocoa powder, baking soda and salt together in a medium bowl and set aside.
2Beat the molasses, sugar and melted butter together in a large bowl with an electric mixer on low speed until combined, 1 to 3 minutes.
3Beat in the egg until incorporated. Beat in the buttermilk until incorporated, scraping down the bowl and beaters as needed. Add the flour mixture, increase the speed to medium, and beat until the batter is smooth and thick, 1 to 3 minutes, scraping down the bowl and beaters as needed.
4Pour the batter into the prepared pan and smooth the top. Bake until a wooden skewer inserted into the center of the cake comes out with a few crumbs attached, about 40 minutes, rotating the pan halfway through baking.
5Let the cake cool in the pan. Serve warm or let cool completely, about 2 hours. Dust cake with powdered sugar, if desired.