diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2020-05-17 03:16:23 -0500 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2020-05-17 03:16:23 -0500 |
commit | f9c5732721d179ab682d08faa9d30d6b711957bf (patch) | |
tree | 07f09361f104ca538c0b3bb8354be0f2d0d2399d | |
parent | 1cf51675a55fecf1f5c2d5bd3e14748eae182489 (diff) | |
download | horizon-f9c5732721d179ab682d08faa9d30d6b711957bf.tar.gz horizon-f9c5732721d179ab682d08faa9d30d6b711957bf.tar.bz2 horizon-f9c5732721d179ab682d08faa9d30d6b711957bf.tar.xz horizon-f9c5732721d179ab682d08faa9d30d6b711957bf.zip |
tests: Add --version tests, fix required installfile tests
-rw-r--r-- | tests/spec/simulator_spec.rb | 26 | ||||
-rw-r--r-- | tests/spec/validator_spec.rb | 6 |
2 files changed, 20 insertions, 12 deletions
diff --git a/tests/spec/simulator_spec.rb b/tests/spec/simulator_spec.rb index 60e0186..ab77782 100644 --- a/tests/spec/simulator_spec.rb +++ b/tests/spec/simulator_spec.rb @@ -8,12 +8,16 @@ RSpec.describe 'HorizonScript Simulator', :type => :aruba do context "argument passing" do it "requires an installfile to be specified" do run_command 'hscript-simulate' - expect(last_command_started).to have_output(/Allowed options/) + expect(last_command_started).to have_output(/must specify an installfile/) end it "supports Strict Mode" do run_command 'hscript-simulate foo -s' expect(last_command_started).to_not have_output(/Allowed options/) end + it "supports version output" do + run_command 'hscript-simulate --version' + expect(last_command_started).to_not have_output(/Allowed options/) + end it "doesn't output ANSI colours when instructed not to" do run_command 'hscript-simulate foo -n' expect(last_command_started).to_not have_output(/\033/) @@ -213,16 +217,16 @@ printf '%s\\t%s\\t%s\\t%s\\t0\\t0\\n' /dev/gwyn/source /usr/src auto noatime >> run_simulate expect(last_command_started.stdout).to include("ln -s /etc/init.d/net.lo /target/etc/init.d/net.eth0") end - it "configures IPv4 addressing correctly with eni" do - use_fixture '0227-netconfigtype-eni.installfile' - run_simulate - expect(last_command_started.stdout).to include("auto eth0\niface eth0 inet static") - end - it "configures IPv6 SLAAC addressing correctly with eni" do - use_fixture '0227-netconfigtype-eni.installfile' - run_simulate - expect(last_command_started.stdout).to include("iface eth0 inet6 manual") - end + it "configures IPv4 addressing correctly with eni" do + use_fixture '0227-netconfigtype-eni.installfile' + run_simulate + expect(last_command_started.stdout).to include("auto eth0\niface eth0 inet static") + end + it "configures IPv6 SLAAC addressing correctly with eni" do + use_fixture '0227-netconfigtype-eni.installfile' + run_simulate + expect(last_command_started.stdout).to include("iface eth0 inet6 manual") + end end context "simulating 'nameserver' execution" do it "configures nameservers correctly" do diff --git a/tests/spec/validator_spec.rb b/tests/spec/validator_spec.rb index 963eecf..365a8f3 100644 --- a/tests/spec/validator_spec.rb +++ b/tests/spec/validator_spec.rb @@ -11,7 +11,11 @@ RSpec.describe 'HorizonScript validation', :type => :aruba do context "Utility argument passing" do it "requires an installfile to be specified" do run_command 'hscript-validate' - expect(last_command_started).to have_output(/Allowed options/) + expect(last_command_started).to have_output(/must specify an installfile/) + end + it "supports version output" do + run_command 'hscript-validate --version' + expect(last_command_started).to_not have_output(/Allowed options/) end it "accepts -i flag" do run_command 'hscript-validate foo -i' |