From 57307442c5d707591dfc4d5e7671364fa564fa5c Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Tue, 8 Oct 2019 19:31:28 -0500 Subject: hscript: Better message for duplicate value, and test for it --- tests/spec/validator.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'tests/spec/validator.rb') diff --git a/tests/spec/validator.rb b/tests/spec/validator.rb index 69fe0d1..bd53853 100644 --- a/tests/spec/validator.rb +++ b/tests/spec/validator.rb @@ -77,5 +77,22 @@ RSpec.describe 'HorizonScript Validation Utility', :type => :aruba do expect(last_command_started).to have_output(/error: .*mount.*/) end end + context "unique keys" do + it "fails with a duplicate 'network' key" do + use_fixture '0018-duplicate-network.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*duplicate.*network/) + end + it "fails with a duplicate 'hostname' key" do + use_fixture '0019-duplicate-hostname.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*duplicate.*hostname/) + end + it "fails with a duplicate 'rootpw' key" do + use_fixture '0020-duplicate-rootpw.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*duplicate.*rootpw/) + end + end end end -- cgit v1.2.3-70-g09d2