diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2023-10-10 23:30:18 -0500 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2023-10-10 23:30:18 -0500 |
commit | 615278f3365087e436ee5ea13e0d15bd60718038 (patch) | |
tree | 9b67e19184a743c0ee3672b6266b281a6d7e8799 /tests/spec/validator_spec.rb | |
parent | 8bb3f48cb970a410d93940c675c4a086af9fbcdd (diff) | |
download | horizon-615278f3365087e436ee5ea13e0d15bd60718038.tar.gz horizon-615278f3365087e436ee5ea13e0d15bd60718038.tar.bz2 horizon-615278f3365087e436ee5ea13e0d15bd60718038.tar.xz horizon-615278f3365087e436ee5ea13e0d15bd60718038.zip |
hscript: Allow multiple inheritance
This allows a HorizonScript to inherit from multiple files. Files are parsed
in a system-defined, unspecified order, but all scripts of a given depth are
guaranteed to be parsed before the next depth.
Diffstat (limited to 'tests/spec/validator_spec.rb')
-rw-r--r-- | tests/spec/validator_spec.rb | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/spec/validator_spec.rb b/tests/spec/validator_spec.rb index 282d7ca..3a491a0 100644 --- a/tests/spec/validator_spec.rb +++ b/tests/spec/validator_spec.rb @@ -80,6 +80,35 @@ RSpec.describe 'HorizonScript validation', :type => :aruba do run_validate expect(last_command_started).to have_output(/error: .*length/) end + context "inheritance" do + it "supports basic single inheritance" do + use_fixture '0232-inherit-basic.installfile' + run_validate + expect(last_command_started).to have_output(PARSER_SUCCESS) + expect(last_command_started).to have_output(VALIDATOR_SUCCESS) + end + it "requires inherited files to exist" do + use_fixture '0233-inherit-missing.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*non-existent/) + end + it "doesn't get stuck in a loop" do + use_fixture '0264-inherit-test-loop.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*already inherited/) + end + it "supports relative paths" do + use_fixture '0236-inherit-relative.installfile' + run_validate + expect(last_command_started).to have_output(PARSER_SUCCESS) + expect(last_command_started).to have_output(VALIDATOR_SUCCESS) + end + it "still knows incomplete files are incomplete" do + use_fixture '0237-inherit-incomplete.installfile' + run_validate + expect(last_command_started).to have_output(/error: expected/) + end + end context "required keys" do # Runner.Validate.Required. # Runner.Validate.network. |