Skip to content

Commit

Permalink
linuxgeneric: update prompt
Browse files Browse the repository at this point in the history
- matches debian default prompt
- unit test for the prompt
  • Loading branch information
robertcheramy committed Sep 27, 2024
1 parent fc34e37 commit 802c33f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
- fixed aosw prompt; now working with ArubaOS 8 (@mabezi, @robertcheramy)
- routeros: fix system info for CHR. Fixes #3180 (@systeembeheerder)
- removed hardcoded '~/.config/oxidized/config'. Fixes #3229 (@robertcheramy)
- linuxgeneric: updated prompt to support '$' at the end (@robertcheramy)

## [0.30.1 – 2024-04-12]

Expand Down
2 changes: 1 addition & 1 deletion lib/oxidized/model/linuxgeneric.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class LinuxGeneric < Oxidized::Model
using Refinements

prompt /^(\w.*|\W.*)(:|#) /
prompt /^(\w.*|\W.*)[:#$] /
comment '# '

# add a comment in the final conf
Expand Down
14 changes: 14 additions & 0 deletions spec/model/linuxgeneric_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
require_relative 'model_helper'

describe 'model/LinuxGeneric' do
before(:each) do
init_model_helper
@node = Oxidized::Node.new(name: 'example.com',
input: 'ssh',
model: 'linuxgeneric')
end

it 'matches different prompts' do
_('robert@gap:~$ ').must_match LinuxGeneric.prompt
end
end

0 comments on commit 802c33f

Please sign in to comment.