Consolidate name transform checking in spec/build_alt.spec.rb into shared_examples