@@ -73,6 +73,28 @@ def test_integration_copilot_creates_files(self, tmp_path):
7373 shared_manifest = project / ".specify" / "integrations" / "speckit.manifest.json"
7474 assert shared_manifest .exists ()
7575
76+ def test_noninteractive_init_defaults_to_copilot (self , tmp_path , monkeypatch ):
77+ from typer .testing import CliRunner
78+ from specify_cli import app
79+ import specify_cli
80+
81+ def fail_select (* _args , ** _kwargs ):
82+ raise AssertionError ("non-interactive init should not open the integration picker" )
83+
84+ monkeypatch .setattr (specify_cli , "select_with_arrows" , fail_select )
85+
86+ runner = CliRunner ()
87+ project = tmp_path / "noninteractive"
88+ result = runner .invoke (app , [
89+ "init" , str (project ), "--script" , "sh" , "--no-git" , "--ignore-agent-tools" ,
90+ ], catch_exceptions = False )
91+
92+ assert result .exit_code == 0 , result .output
93+ assert (project / ".github" / "agents" / "speckit.plan.agent.md" ).exists ()
94+
95+ data = json .loads ((project / ".specify" / "integration.json" ).read_text (encoding = "utf-8" ))
96+ assert data ["integration" ] == "copilot"
97+
7698 def test_ai_copilot_auto_promotes (self , tmp_path ):
7799 from typer .testing import CliRunner
78100 from specify_cli import app
0 commit comments