diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-10-08 21:41:24 -0500 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-10-08 21:41:24 -0500 |
commit | decc6e87d9ab84aac5a000937d7e19f2fcefd911 (patch) | |
tree | 49e77212fc895e059bbed44a90a16b9d5773647a /tests/spec | |
parent | 3e948338a90dd6bd0ddc2582cf37c908f3611c56 (diff) | |
download | horizon-decc6e87d9ab84aac5a000937d7e19f2fcefd911.tar.gz horizon-decc6e87d9ab84aac5a000937d7e19f2fcefd911.tar.bz2 horizon-decc6e87d9ab84aac5a000937d7e19f2fcefd911.tar.xz horizon-decc6e87d9ab84aac5a000937d7e19f2fcefd911.zip |
tests: Add some new tests and fix test 15
Diffstat (limited to 'tests/spec')
-rw-r--r-- | tests/spec/validator.rb | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/tests/spec/validator.rb b/tests/spec/validator.rb index 4efe03c..1c3657e 100644 --- a/tests/spec/validator.rb +++ b/tests/spec/validator.rb @@ -24,12 +24,13 @@ RSpec.describe 'HorizonScript Validation Utility', :type => :aruba do end end context "on invalid keys" do - before(:each) { use_fixture '0016-invalid-key.installfile' } it "warns on invalid keys by default" do + use_fixture '0016-invalid-key.installfile' run_validate expect(last_command_started).to have_output(/warning: .*chat.* not defined/) end it "errors on invalid keys in strict mode" do + use_fixture '0016-invalid-key.installfile' run_validate ' --strict' expect(last_command_started).to have_output(/error: .*chat.* not defined/) end @@ -53,7 +54,7 @@ RSpec.describe 'HorizonScript Validation Utility', :type => :aruba do it "requires keys to have values" do use_fixture '0015-keys-without-values.installfile' run_validate ' --keep-going' - expect(last_command_started).to have_output(/5 error\(s\)/) + expect(last_command_started).to have_output(/2 error\(s\)/) end it "fails on lines over maximum line length" do use_fixture '0017-line-too-long.installfile' @@ -126,5 +127,17 @@ RSpec.describe 'HorizonScript Validation Utility', :type => :aruba do expect(last_command_started).to have_output(/error: .*duplicate.*rootpw/) end end + context "package specifications" do + 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(SUCCESS_OUTPUT) + end + it "does not accept invalid package atoms" do + use_fixture '0023-pkginstall-invalid-modifier.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*expected package.*/) + end + end end end |