diff options
| author | Paul Buetow <paul@buetow.org> | 2026-03-14 10:55:38 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-03-14 10:55:38 +0200 |
| commit | 8b0531bec5e9229ca41ab7bf143e319f66ed0a22 (patch) | |
| tree | c705122a5d645cf77e4162a93f3bbfc56fa5c84c /test/lib/dslkeywords/agent_test.rb | |
| parent | 2b4c2d4bbb47b59fb8bf7fec027efd36b1352857 (diff) | |
Resolve multi-word agent names in file DSLdevelop
Diffstat (limited to 'test/lib/dslkeywords/agent_test.rb')
| -rw-r--r-- | test/lib/dslkeywords/agent_test.rb | 40 |
1 files changed, 35 insertions, 5 deletions
diff --git a/test/lib/dslkeywords/agent_test.rb b/test/lib/dslkeywords/agent_test.rb index d3fc49f..b09a2ec 100644 --- a/test/lib/dslkeywords/agent_test.rb +++ b/test/lib/dslkeywords/agent_test.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -# rubocop:disable Metrics/ClassLength, Metrics/MethodLength +# rubocop:disable Metrics/ClassLength, Metrics/MethodLength, Metrics/AbcSize require 'minitest/autorun' require 'fileutils' require 'rbconfig' @@ -117,22 +117,52 @@ class RCMAgentTest < Minitest::Test File.write(file_path, 'abc123') configure_from_scratch do - agent 'reverse via file' do + agent reverse via file do command end - prompt 'no op' do + prompt no op do '' end file file_path do - agent 'reverse via file', 'no op' + agent reverse via file no op end end assert_equal '321cba', File.read(file_path) end + def test_agent_spec_raises_when_multiword_split_is_ambiguous + file_path = path('ambiguous.txt') + command = mock_agent_command(:pass_through) + File.write(file_path, 'hello') + + assert_raises(RCM::File::InvalidAgentSpec) do + configure_from_scratch do + agent alpha do + command + end + + agent alpha beta do + command + end + + prompt gamma do + '' + end + + prompt beta gamma do + '' + end + + file file_path do + agent alpha beta gamma + end + end + end + end + def test_agent_can_use_file_path_placeholder file_path = path('placeholder.txt') command = mock_agent_command(:basename, 'FILE_PATH') @@ -346,4 +376,4 @@ class RCMAgentTest < Minitest::Test end end -# rubocop:enable Metrics/ClassLength, Metrics/MethodLength +# rubocop:enable Metrics/ClassLength, Metrics/MethodLength, Metrics/AbcSize |
