diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-10-19 23:29:38 -0500 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-10-19 23:29:38 -0500 |
commit | e03c1e50653584b7bb4b2173e991164f41329e10 (patch) | |
tree | f6881ef301368d7cc8ab1e17782ed52af65a9bcd /tests | |
parent | 08c14a952d9e7726854b380001b1d157b4528a3d (diff) | |
download | horizon-e03c1e50653584b7bb4b2173e991164f41329e10.tar.gz horizon-e03c1e50653584b7bb4b2173e991164f41329e10.tar.bz2 horizon-e03c1e50653584b7bb4b2173e991164f41329e10.tar.xz horizon-e03c1e50653584b7bb4b2173e991164f41329e10.zip |
tests: Rework RSpec stuff entirely
Diffstat (limited to 'tests')
-rw-r--r-- | tests/spec/simulator_spec.rb (renamed from tests/spec/simulator.rb) | 15 | ||||
-rw-r--r-- | tests/spec/spec_helper.rb | 13 | ||||
-rw-r--r-- | tests/spec/validator_spec.rb (renamed from tests/spec/validator.rb) | 15 |
3 files changed, 13 insertions, 30 deletions
diff --git a/tests/spec/simulator.rb b/tests/spec/simulator_spec.rb index 2fc3273..cc1951a 100644 --- a/tests/spec/simulator.rb +++ b/tests/spec/simulator_spec.rb @@ -1,22 +1,7 @@ -require 'aruba/rspec' - -IFILE_PATH = 'installfile' - def run_simulate(extra = '') run_command 'hscript-simulate ' + IFILE_PATH + extra end -def use_fixture(fixture) - copy '%/' + fixture, IFILE_PATH -end - -Aruba.configure do |config| - config.fixtures_directory = "fixtures" if respond_to? :fixtures_directory= - config.fixtures_directories = %w(fixtures) if respond_to? :fixtures_directories= - config.keep_ansi = true if respond_to? :keep_ansi= - config.remove_ansi_escape_sequences = false if respond_to? :remove_ansi_escape_sequences= -end - RSpec.describe 'HorizonScript Simulator', :type => :aruba do context "argument passing" do it "requires an installfile to be specified" do diff --git a/tests/spec/spec_helper.rb b/tests/spec/spec_helper.rb index 886ed85..bc2a7b3 100644 --- a/tests/spec/spec_helper.rb +++ b/tests/spec/spec_helper.rb @@ -1,3 +1,5 @@ +require 'aruba/rspec' + # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration RSpec.configure do |config| config.expect_with :rspec do |expectations| @@ -50,3 +52,14 @@ RSpec.configure do |config| # as the one that triggered the failure. Kernel.srand config.seed end + +Aruba.configure do |config| + config.fixtures_directories = %w(fixtures) + config.remove_ansi_escape_sequences = false if respond_to? :remove_ansi_escape_sequences= +end + +IFILE_PATH = 'installfile' + +def use_fixture(fixture) + copy '%/' + fixture, IFILE_PATH +end diff --git a/tests/spec/validator.rb b/tests/spec/validator_spec.rb index de43cbb..36af73a 100644 --- a/tests/spec/validator.rb +++ b/tests/spec/validator_spec.rb @@ -1,22 +1,7 @@ -require 'aruba/rspec' - -IFILE_PATH = 'installfile' - def run_validate(extra = '') run_command 'hscript-validate ' + IFILE_PATH + extra end -def use_fixture(fixture) - copy '%/' + fixture, IFILE_PATH -end - -Aruba.configure do |config| - config.fixtures_directory = "fixtures" if respond_to? :fixtures_directory= - config.fixtures_directories = %w(fixtures) if respond_to? :fixtures_directories= - config.keep_ansi = true if respond_to? :keep_ansi= - config.remove_ansi_escape_sequences = false if respond_to? :remove_ansi_escape_sequences= -end - PARSER_SUCCESS = /parser: 0 error\(s\), 0 warning\(s\)/ VALIDATOR_SUCCESS = /validator: 0 failure\(s\)/ |