diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-10-21 00:18:02 -0500 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-10-21 00:18:02 -0500 |
commit | 25750e7495e178fc22a07cd1d9dcfd34c7141036 (patch) | |
tree | 9c8765a825ec4a40b7caed0d3e3ddf15b631d183 /tests/spec/validator_spec.rb | |
parent | 64b7153ce0079f62331a2e66f45c4bbd0c703028 (diff) | |
download | horizon-25750e7495e178fc22a07cd1d9dcfd34c7141036.tar.gz horizon-25750e7495e178fc22a07cd1d9dcfd34c7141036.tar.bz2 horizon-25750e7495e178fc22a07cd1d9dcfd34c7141036.tar.xz horizon-25750e7495e178fc22a07cd1d9dcfd34c7141036.zip |
hscript: Implement Language, add tests
Diffstat (limited to 'tests/spec/validator_spec.rb')
-rw-r--r-- | tests/spec/validator_spec.rb | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/tests/spec/validator_spec.rb b/tests/spec/validator_spec.rb index 08f5886..3ed43ea 100644 --- a/tests/spec/validator_spec.rb +++ b/tests/spec/validator_spec.rb @@ -186,6 +186,44 @@ RSpec.describe 'HorizonScript validation', :type => :aruba do expect(last_command_started).to have_output(/error: .*firmware.*value/) end end + context "for 'language' key" do + # Runner.Validate.language + # Runner.Validate.language.Format + it "supports a simple language" do + use_fixture '0115-language-simple.installfile' + run_validate + expect(last_command_started).to have_output(PARSER_SUCCESS) + expect(last_command_started).to have_output(VALIDATOR_SUCCESS) + end + it "supports a language_territory value" do + use_fixture '0116-language-country.installfile' + run_validate + expect(last_command_started).to have_output(PARSER_SUCCESS) + expect(last_command_started).to have_output(VALIDATOR_SUCCESS) + end + it "supports the UTF-8 codeset" do + use_fixture '0117-language-codeset.installfile' + run_validate + expect(last_command_started).to have_output(PARSER_SUCCESS) + expect(last_command_started).to have_output(VALIDATOR_SUCCESS) + end + it "supports the special case C.UTF-8" do + use_fixture '0118-language-c-exception.installfile' + run_validate + expect(last_command_started).to have_output(PARSER_SUCCESS) + expect(last_command_started).to have_output(VALIDATOR_SUCCESS) + end + it "requires a valid language" do + use_fixture '0119-language-invalid.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*language.*invalid/) + end + it "requires the UTF-8 codeset" do + use_fixture '0120-language-iso.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*language.*codeset/) + end + end context "for 'mount' key" do # Runner.Validate.mount. it "fails with an invalid value" do @@ -537,6 +575,11 @@ RSpec.describe 'HorizonScript validation', :type => :aruba do skip "This build does not support firmware" if last_command_started.stdout !~ /supports non-free/ expect(last_command_started).to have_output(/error: .*duplicate.*firmware/) end + it "fails with a duplicate 'language' key" do + use_fixture '0121-language-duplicate.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*duplicate.*language/) + end end context "user account keys:" do context "'username'" do |