summaryrefslogtreecommitdiff
path: root/tests/spec/validator_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'tests/spec/validator_spec.rb')
-rw-r--r--tests/spec/validator_spec.rb29
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.