diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-10-18 19:41:28 -0500 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-10-18 19:41:28 -0500 |
commit | 918125404fdf222caef16f8cf3798e20266ae662 (patch) | |
tree | 19df60cf84f58d0fd26809598910c046f561d002 /tests/spec/validator.rb | |
parent | 1f64481933503f9ee12603a2ef076e5e1e987abe (diff) | |
download | horizon-918125404fdf222caef16f8cf3798e20266ae662.tar.gz horizon-918125404fdf222caef16f8cf3798e20266ae662.tar.bz2 horizon-918125404fdf222caef16f8cf3798e20266ae662.tar.xz horizon-918125404fdf222caef16f8cf3798e20266ae662.zip |
hscript: Implement some Username logic, add tests
Diffstat (limited to 'tests/spec/validator.rb')
-rw-r--r-- | tests/spec/validator.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/spec/validator.rb b/tests/spec/validator.rb index d54006d..16f397a 100644 --- a/tests/spec/validator.rb +++ b/tests/spec/validator.rb @@ -53,18 +53,21 @@ RSpec.describe 'HorizonScript Validation Utility', :type => :aruba do use_fixture '0001-basic.installfile' run_validate expect(last_command_started).to have_output(PARSER_SUCCESS) + expect(last_command_started).to have_output(VALIDATOR_SUCCESS) end # HorizonScript Specification, ch 3. it "handles comments" do use_fixture '0002-basic-commented.installfile' run_validate expect(last_command_started).to have_output(PARSER_SUCCESS) + expect(last_command_started).to have_output(VALIDATOR_SUCCESS) end # HorizonScript Specification, ch 3. it "handles blank lines and indentation" do use_fixture '0003-basic-whitespace.installfile' run_validate expect(last_command_started).to have_output(PARSER_SUCCESS) + expect(last_command_started).to have_output(VALIDATOR_SUCCESS) end it "requires keys to have values" do use_fixture '0015-keys-without-values.installfile' @@ -505,12 +508,33 @@ RSpec.describe 'HorizonScript Validation Utility', :type => :aruba do expect(last_command_started).to have_output(/error: .*duplicate.*rootpw/) end end + context "user account keys:" do + context "'username'" do + it "succeeds with multiple usernames" do + use_fixture '0082-username-basic.installfile' + run_validate + expect(last_command_started).to have_output(PARSER_SUCCESS) + expect(last_command_started).to have_output(VALIDATOR_SUCCESS) + end + it "fails with duplicate usernames" do + use_fixture '0083-username-duplicate.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*duplicate.*username/) + end + it "fails with a system username" do + use_fixture '0084-username-system.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*username.*system/) + end + end + end context "package specifications" do # no requirements for these, but I think obvious. it "works with all types of package atoms" do use_fixture '0022-all-kinds-of-atoms.installfile' run_validate expect(last_command_started).to have_output(PARSER_SUCCESS) + expect(last_command_started).to have_output(VALIDATOR_SUCCESS) end it "does not accept invalid package atoms" do use_fixture '0023-pkginstall-invalid-modifier.installfile' |