diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-10-19 17:23:00 -0500 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-10-19 17:23:00 -0500 |
commit | 55325a6e780b121f93d35076e4226521ca13ef12 (patch) | |
tree | b3cf5fa6131fa966e7427b8837311c8dcdc9ceaa /tests/spec/validator.rb | |
parent | d3489c52d4ad1e5b17ce88e8b0e5142b30bb324e (diff) | |
download | horizon-55325a6e780b121f93d35076e4226521ca13ef12.tar.gz horizon-55325a6e780b121f93d35076e4226521ca13ef12.tar.bz2 horizon-55325a6e780b121f93d35076e4226521ca13ef12.tar.xz horizon-55325a6e780b121f93d35076e4226521ca13ef12.zip |
hscript: Implement UserIcon parsing
Diffstat (limited to 'tests/spec/validator.rb')
-rw-r--r-- | tests/spec/validator.rb | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/spec/validator.rb b/tests/spec/validator.rb index 76f1c6f..e43e5ed 100644 --- a/tests/spec/validator.rb +++ b/tests/spec/validator.rb @@ -612,6 +612,45 @@ RSpec.describe 'HorizonScript validation', :type => :aruba do expect(last_command_started).to have_output(/warning: .*passphrase/) end end + context "'usericon'" do + # Runner.Validate.usericon. + it "succeeds with a valid icon/account pair" do + use_fixture '0098-usericon-basic.installfile' + run_validate + expect(last_command_started).to have_output(PARSER_SUCCESS) + expect(last_command_started).to have_output(VALIDATOR_SUCCESS) + end + # Runner.Validate.usericon.Validity. + it "requires a path to be provided" do + use_fixture '0099-usericon-without-icon.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*usericon.*required/) + end + # Runner.Validate.usericon.Name. + it "fails with a username that wasn't given" do + use_fixture '0100-usericon-unknown-name.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*usericon.*name/) + end + # Runner.Validate.usericon.Unique. + it "fails with multiple icons associated with a single account" do + use_fixture '0101-usericon-duplicate.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*duplicate.*usericon/) + end + # Runner.Validate.usericon.ValidPath. + it "succeeds with all supported protocols" do + use_fixture '0102-usericon-protocols.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 an unsupported protocol" do + use_fixture '0103-usericon-gopher.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*usericon.*URL/) + end + end end context "package specifications" do # no requirements for these, but I think obvious. |