@@ -180,6 +180,19 @@ def test_json_output_keys(self, git_repo: Path):
180180 assert key in data , f"missing { key } in JSON: { data } "
181181 assert re .match (r"^\d{8}-\d{6}$" , data ["FEATURE_NUM" ])
182182
183+ def test_writes_feature_metadata_file (self , git_repo : Path ):
184+ """The create script persists .specify/feature.json for downstream commands."""
185+ import json
186+
187+ result = run_script (git_repo , "--json" , "--short-name" , "meta-test" , "Metadata test" )
188+ assert result .returncode == 0 , result .stderr
189+ data = json .loads (result .stdout )
190+
191+ metadata_file = git_repo / ".specify" / "feature.json"
192+ assert metadata_file .exists (), "feature metadata file was not created"
193+ metadata = json .loads (metadata_file .read_text (encoding = "utf-8" ))
194+ assert metadata == {"feature_directory" : f"specs/{ data ['BRANCH_NAME' ]} " }
195+
183196 def test_long_name_truncation (self , git_repo : Path ):
184197 """Test 5: Long branch name is truncated to <= 244 chars."""
185198 long_name = "a-" * 150 + "end"
@@ -993,7 +1006,19 @@ def test_ps_dry_run_json_absent_without_flag(self, ps_git_repo: Path):
9931006 assert result .returncode == 0 , result .stderr
9941007 data = json .loads (result .stdout )
9951008 assert "DRY_RUN" not in data , f"DRY_RUN should not be in normal JSON: { data } "
1009+
1010+ def test_ps_writes_feature_metadata_file (self , ps_git_repo : Path ):
1011+ """PowerShell create script persists .specify/feature.json."""
1012+ result = run_ps_script (
1013+ ps_git_repo , "-Json" , "-ShortName" , "ps-meta" , "PowerShell metadata"
1014+ )
1015+ assert result .returncode == 0 , result .stderr
1016+ data = json .loads (result .stdout )
9961017
1018+ metadata_file = ps_git_repo / ".specify" / "feature.json"
1019+ assert metadata_file .exists (), "feature metadata file was not created"
1020+ metadata = json .loads (metadata_file .read_text (encoding = "utf-8-sig" ))
1021+ assert metadata == {"feature_directory" : f"specs/{ data ['BRANCH_NAME' ]} " }
9971022
9981023# ── GIT_BRANCH_NAME Override Tests ──────────────────────────────────────────
9991024
0 commit comments