From d39982a1983fcb945efe53d97610be2385cc4810 Mon Sep 17 00:00:00 2001 From: Nilambar Sharma Date: Wed, 13 Mar 2024 11:09:03 +0545 Subject: [PATCH] Add feature test for sections pre, post and body --- features/scaffold-package-readme.feature | 33 ++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/features/scaffold-package-readme.feature b/features/scaffold-package-readme.feature index 93953ad..71fd13b 100644 --- a/features/scaffold-package-readme.feature +++ b/features/scaffold-package-readme.feature @@ -199,6 +199,39 @@ Feature: Scaffold a README.md file for an existing package Support isn't free! """ + Scenario: Scaffold a readme with a pre, post and body for the section + Given an empty directory + And a foo/composer.json file: + """ + { + "name": "runcommand/profile", + "description": "Quickly identify what's slow with WordPress.", + "homepage": "https://runcommand.io/wp/profile/", + "extra": { + "readme": { + "contributing": { + "pre": "[Visit Site](https://example.com)", + "body": "https://gist.githubusercontent.com/danielbachhuber/bb652b1b744cea541705ee9c13605dad/raw/195c17ebb8cf25e947a9df6e02de1e96a084c287/support.md", + "post": "I am after body." + } + } + } + } + """ + + When I run `wp scaffold package-readme foo` + Then the foo/README.md file should exist + And the foo/README.md file should contain: + """ + ## Contributing + + [Visit Site](https://example.com) + + Support isn't free! + + I am after body. + """ + Scenario: Scaffold a readme with custom sections Given an empty directory And a foo/composer.json file: