diff --git a/config/dynniq_ec2.yaml b/config/dynniq_ec2.yaml index 2ee88ee2..f45d076e 100644 --- a/config/dynniq_ec2.yaml +++ b/config/dynniq_ec2.yaml @@ -39,5 +39,4 @@ secrets: 2: 2503 restrict_testing: core_version: 3.1.2 - sxl_version: 1.0.7 - + sxl_version: 1.0.7 diff --git a/config/swarco_itc2.yaml b/config/swarco_itc2.yaml index efa039b4..b29f1432 100644 --- a/config/swarco_itc2.yaml +++ b/config/swarco_itc2.yaml @@ -41,8 +41,8 @@ secrets: 2: testcode2 restrict_testing: core_version: 3.1.2 - sxl_version: 1.0.7 + sxl_version: 1.0.7 alarms: - A0302: + A0302: component: KK+AG9998=001DL001 activation_input: 152 diff --git a/spec/site/core/aggregated_status_spec.rb b/spec/site/core/aggregated_status_spec.rb index 7a0810c2..41689fbe 100644 --- a/spec/site/core/aggregated_status_spec.rb +++ b/spec/site/core/aggregated_status_spec.rb @@ -5,7 +5,7 @@ # Verify that the controller responds to an aggregated status request. # # 1. Given the site is connected - # 2. Request aggregated status + # 2. Request aggregated status # 3. Expect aggregated status response before timeout it 'can be requested', core: '>=3.1.5' do |example| Validator::Site.connected do |task,supervisor,site| diff --git a/spec/site/site_spec.rb b/spec/site/site_spec.rb index 1b249965..8e0ba669 100644 --- a/spec/site/site_spec.rb +++ b/spec/site/site_spec.rb @@ -1,3 +1,3 @@ -# Tests for RSMP sites (as opposed to supervisors), like traffic light controllers. +# Tests for RSMP sites (as opposed to supervisors), like traffic light controllers. RSpec.describe 'Site' do end diff --git a/spec/site/tlc/alarm_spec.rb b/spec/site/tlc/alarm_spec.rb index f8c0225e..df8d88ac 100644 --- a/spec/site/tlc/alarm_spec.rb +++ b/spec/site/tlc/alarm_spec.rb @@ -14,7 +14,6 @@ # because validator is meant for automated testing. describe 'Alarm' do - # Validate that a detector logic fault A0302 is raises and cleared. # # The test requires that the device is programmed so that the alarm @@ -81,7 +80,7 @@ def verify_timestamp alarm, duration=1.minute # # 1. Given the site is connected # 2. When we trigger an alarm - # 2. Then we should receive an unacknowledged alarm issue + # 2. Then we should receive an unacknowledged alarm issue # 4. When we acknowledge the alarm # 5. Then we should recieve an acknowledged alarm issue @@ -184,7 +183,7 @@ def verify_timestamp alarm, duration=1.minute # clean up by resuming alarm resume.attributes['mId'] = RSMP::Message.make_m_id # generate a message id, that can be used to listen for responses collect_task = task.async do - RSMP::AlarmCollector.new(site, + RSMP::AlarmCollector.new(site, m_id: resume.m_id, num: 1, query: {'aCI'=>alarm_code_id,'aSp'=>'Suspend','sS'=>'notSuspended'}, diff --git a/spec/site/tlc/clock_spec.rb b/spec/site/tlc/clock_spec.rb index fec88d81..94253e6a 100644 --- a/spec/site/tlc/clock_spec.rb +++ b/spec/site/tlc/clock_spec.rb @@ -76,12 +76,12 @@ ) max_diff = - Validator.config['timeouts']['command_response'] + + Validator.config['timeouts']['command_response'] + Validator.config['timeouts']['status_response'] diff = received - CLOCK diff = diff.round - expect(diff.abs).to be <= max_diff, + expect(diff.abs).to be <= max_diff, "Clock reported by S0096 is off by #{diff}s, should be within #{max_diff}s" end end @@ -116,7 +116,7 @@ max_diff = Validator.config['timeouts']['command_response'] + Validator.config['timeouts']['status_response'] diff = Time.parse(collector.messages.first.attributes['sTs']) - CLOCK - diff = diff.round + diff = diff.round expect(diff.abs).to be <= max_diff, "Timestamp of S0096 is off by #{diff}s, should be within #{max_diff}s" end @@ -241,4 +241,4 @@ end end end -end \ No newline at end of file +end diff --git a/spec/site/tlc/detector_logics_spec.rb b/spec/site/tlc/detector_logics_spec.rb index e2c72e1e..65a7f738 100644 --- a/spec/site/tlc/detector_logics_spec.rb +++ b/spec/site/tlc/detector_logics_spec.rb @@ -1,4 +1,4 @@ -RSpec.describe 'Site::Traffic Light Controller' do +RSpec.describe 'Site::Traffic Light Controller' do include Validator::CommandHelpers include Validator::StatusHelpers diff --git a/spec/site/tlc/emergency_routes_spec.rb b/spec/site/tlc/emergency_routes_spec.rb index 322fc1cb..2c95e256 100644 --- a/spec/site/tlc/emergency_routes_spec.rb +++ b/spec/site/tlc/emergency_routes_spec.rb @@ -1,4 +1,4 @@ -RSpec.describe 'Site::Traffic Light Controller' do +RSpec.describe 'Site::Traffic Light Controller' do include Validator::CommandHelpers include Validator::StatusHelpers @@ -6,7 +6,7 @@ # 1. Verify connection # 2. Verify that there is a Validator.config['validator'] with a emergency_route # 3. Send control command to switch emergency_route - # 4. Wait for status "emergency_route" = requested + # 4. Wait for status "emergency_route" = requested it 'can be activated with M0005', sxl: '>=1.0.7' do |example| emergency_routes = Validator.config['items']['emergency_routes'] skip("No emergency routes configured") if emergency_routes.nil? || emergency_routes.empty? @@ -15,6 +15,5 @@ emergency_routes.each { |emergency_route| switch_emergency_route emergency_route.to_s } end end - end end diff --git a/spec/site/tlc/io_spec.rb b/spec/site/tlc/io_spec.rb index a7038db8..1b0840da 100644 --- a/spec/site/tlc/io_spec.rb +++ b/spec/site/tlc/io_spec.rb @@ -1,4 +1,4 @@ -RSpec.describe 'Site::Traffic Light Controller' do +RSpec.describe 'Site::Traffic Light Controller' do include Validator::CommandHelpers include Validator::StatusHelpers @@ -20,7 +20,7 @@ # 1. Verify connection # 2. Send control command to set force input - # 3. Wait for status = true + # 3. Wait for status = true specify 'forcing is set with M0019', sxl: '>=1.0.13' do |example| Validator::Site.connected do |task,supervisor,site| @@ -76,12 +76,12 @@ ) end - end + end # 1. Verify connection # 2. Verify that there is a Validator.config['validator'] with a input # 3. Send control command to switch input - # 4. Wait for status "input" = requested + # 4. Wait for status "input" = requested it 'is activated with M0006', sxl: '>=1.0.7' do |example| inputs = Validator.config['items']['inputs'] skip("No inputs configured") if inputs.nil? || inputs.empty? @@ -93,7 +93,7 @@ # 1. Verify connection # 2. Send control command to set a serie of input - # 3. Wait for status = true + # 3. Wait for status = true specify 'series is activated with M0013', sxl: '>=1.0.8' do |example| Validator::Site.connected do |task,supervisor,site| status = "3,4143,65;12,1,4" @@ -104,7 +104,7 @@ # 1. Verify connection # 2. Send control command to set trigger level - # 3. Wait for status = true + # 3. Wait for status = true specify 'sensitivity is set with M0021', sxl: '>=1.0.15' do |example| Validator::Site.connected do |task,supervisor,site| prepare task, site diff --git a/spec/site/tlc/modes_spec.rb b/spec/site/tlc/modes_spec.rb index 5078a6e3..73958f2a 100644 --- a/spec/site/tlc/modes_spec.rb +++ b/spec/site/tlc/modes_spec.rb @@ -192,7 +192,7 @@ status_list = { S0012: [:status,:intersection,:source] } else status_list = { S0012: [:status,:intersection] } - end + end request_status_and_confirm site, "all-red status", status_list end end diff --git a/spec/site/tlc/signal_groups_spec.rb b/spec/site/tlc/signal_groups_spec.rb index ce0b5cdf..81ef9824 100644 --- a/spec/site/tlc/signal_groups_spec.rb +++ b/spec/site/tlc/signal_groups_spec.rb @@ -1,4 +1,4 @@ -RSpec.describe 'Site::Traffic Light Controller' do +RSpec.describe 'Site::Traffic Light Controller' do include Validator::CommandHelpers include Validator::StatusHelpers @@ -7,7 +7,7 @@ # # 1. Verify connection # 2. Send control command to start signalgrup, set_signal_start= true, include security_code - # 3. Wait for status = true + # 3. Wait for status = true it 'is ordered to green with M0010', :important, sxl: '>=1.0.8' do |example| Validator::Site.connected do |task,supervisor,site| prepare task, site @@ -17,7 +17,7 @@ # 1. Verify connection # 2. Send control command to stop signalgrup, set_signal_start= false, include security_code - # 3. Wait for status = true + # 3. Wait for status = true it 'is ordered to red with M0011', :important, sxl: '>=1.0.8' do |example| Validator::Site.connected do |task,supervisor,site| prepare task, site @@ -60,7 +60,7 @@ # 1. Verify connection # 2. Send control command to start or stop a serie of signalgroups - # 3. Wait for status = true + # 3. Wait for status = true specify 'series can be started/stopped with M0012', :important, sxl: '>=1.0.8' do |example| Validator::Site.connected do |task,supervisor,site| prepare task, site diff --git a/spec/site/tlc/signal_plans_spec.rb b/spec/site/tlc/signal_plans_spec.rb index 167bb382..dbee015c 100644 --- a/spec/site/tlc/signal_plans_spec.rb +++ b/spec/site/tlc/signal_plans_spec.rb @@ -73,7 +73,7 @@ # 1. Verify connection # 2. Send control command to set week_table - # 3. Wait for status = true + # 3. Wait for status = true specify 'week table is set with M0016', sxl: '>=1.0.13' do |example| Validator::Site.connected do |task,supervisor,site| status = "0-1,6-2" @@ -96,7 +96,7 @@ # 1. Verify connection # 2. Send control command to set time_table - # 3. Wait for status = true + # 3. Wait for status = true specify 'day table is set with M0017', sxl: '>=1.0.13' do |example| Validator::Site.connected do |task,supervisor,site| status = "12-1-12-59,1-0-23-12" @@ -119,7 +119,7 @@ # 1. Verify connection # 2. Send control command to set cycle time - # 3. Wait for status = true + # 3. Wait for status = true it 'M0018 set cycle time', sxl: '>=1.0.13' do |example| Validator::Site.connected do |task,supervisor,site| status = 5 @@ -210,7 +210,7 @@ # 1. Verify connection # 2. Send control command to set dynamic_bands - # 3. Wait for status = true + # 3. Wait for status = true specify 'offset is set with M0015', sxl: '>=1.0.13' do |example| Validator::Site.connected do |task,supervisor,site| plan = 1 @@ -234,7 +234,7 @@ # 1. Verify connection # 2. Send control command to set cycle time - # 3. Wait for status = true + # 3. Wait for status = true specify 'cycle time is set with M0018', sxl: '>=1.0.13' do |example| Validator::Site.connected do |task,supervisor,site| status = 5 diff --git a/spec/site/tlc/signal_priority_spec.rb b/spec/site/tlc/signal_priority_spec.rb index 44ecc3dd..0e2cc8ec 100644 --- a/spec/site/tlc/signal_priority_spec.rb +++ b/spec/site/tlc/signal_priority_spec.rb @@ -120,7 +120,7 @@ def send_priority_request log, id:nil, site:, component: site.send_command component, command_list end - send_priority_request "Send an unrelated signal priority request before", + send_priority_request "Send an unrelated signal priority request before", site: site, component: component send_priority_request "Send our signal priority request", site: site, component: component, id: request_id diff --git a/spec/site/tlc/system_spec.rb b/spec/site/tlc/system_spec.rb index 621da62a..caa0902c 100644 --- a/spec/site/tlc/system_spec.rb +++ b/spec/site/tlc/system_spec.rb @@ -1,4 +1,4 @@ -RSpec.describe 'Site::Traffic Light Controller' do +RSpec.describe 'Site::Traffic Light Controller' do include Validator::CommandHelpers include Validator::StatusHelpers diff --git a/spec/site/tlc/tlc_spec.rb b/spec/site/tlc/tlc_spec.rb index ac1cfc8d..d0ae9ddc 100644 --- a/spec/site/tlc/tlc_spec.rb +++ b/spec/site/tlc/tlc_spec.rb @@ -1,5 +1,5 @@ RSpec.describe 'Site' do - # Tests for Traffic Light Controllers. - describe 'Traffic Light Controller' do - end + # Tests for Traffic Light Controllers. + describe 'Traffic Light Controller' do + end end diff --git a/spec/site/tlc/traffic_situations_spec.rb b/spec/site/tlc/traffic_situations_spec.rb index 07af2c6d..0f23e8a4 100644 --- a/spec/site/tlc/traffic_situations_spec.rb +++ b/spec/site/tlc/traffic_situations_spec.rb @@ -1,4 +1,4 @@ -RSpec.describe 'Site::Traffic Light Controller' do +RSpec.describe 'Site::Traffic Light Controller' do include Validator::CommandHelpers include Validator::StatusHelpers diff --git a/spec/supervisor/aggregated_status_spec.rb b/spec/supervisor/aggregated_status_spec.rb index 701afdeb..371b6874 100644 --- a/spec/supervisor/aggregated_status_spec.rb +++ b/spec/supervisor/aggregated_status_spec.rb @@ -1,6 +1,6 @@ RSpec.describe 'Supervisor' do - # Validate behaviour related to aggregated status messages + # Validate behaviour related to aggregated status messages describe 'Aggregated Status' do # Validate that the supervisor responds correctly when we send an aggregated status message @@ -17,4 +17,4 @@ end end end -end \ No newline at end of file +end diff --git a/spec/support/command_helpers.rb b/spec/support/command_helpers.rb index ee2ded3d..8ce3288f 100644 --- a/spec/support/command_helpers.rb +++ b/spec/support/command_helpers.rb @@ -321,7 +321,7 @@ def set_security_code level end def require_security_codes - unless Validator.config.dig 'secrets', 'security_codes' + unless Validator.config.dig 'secrets', 'security_codes' skip "Security codes are not configured" end end @@ -448,7 +448,7 @@ def wrong_security_code component = Validator.config['components']['detector_logic'].keys[0] result = @site.send_command component, command_list, collect!: { timeout: Validator.config['timeouts']['command_response'] - } + } end def wait_normal_control timeout: Validator.config['timeouts']['startup_sequence'] diff --git a/spec/support/formatters/brief.rb b/spec/support/formatters/brief.rb index be65e61f..bc7b046f 100644 --- a/spec/support/formatters/brief.rb +++ b/spec/support/formatters/brief.rb @@ -24,7 +24,7 @@ def example_passed notification @output << colorize("#{indent}#{notification.example.description}\n",:success) end - def example_failed notification + def example_failed notification @output << colorize("#{indent}#{notification.example.description}",:failure) # expect { }.not_to raise_error might raise an RSpec::Expectations::ExpectationNotMetError, @@ -44,4 +44,4 @@ def example_pending notification def dump_failures notification end end -end \ No newline at end of file +end diff --git a/spec/support/formatters/details.rb b/spec/support/formatters/details.rb index 780fd720..8a55f55f 100644 --- a/spec/support/formatters/details.rb +++ b/spec/support/formatters/details.rb @@ -34,7 +34,7 @@ def example_passed notification # ExampleNotification @output << colorize(" Passed\n\n",:success) end - def example_failed notification + def example_failed notification # RSpec::Core::Formatters::ExceptionPresenter is a private class which # should not really be used by us, but the snippet extraction and backtrace # processing seems rather cumbersome to reimplement @@ -56,4 +56,4 @@ def dump_pending notification super notification end end -end \ No newline at end of file +end diff --git a/spec/support/formatters/formatter_base.rb b/spec/support/formatters/formatter_base.rb index d41cdb21..aeb9b3b7 100644 --- a/spec/support/formatters/formatter_base.rb +++ b/spec/support/formatters/formatter_base.rb @@ -32,7 +32,7 @@ def dump_pending notification def dump_sentinel_warnings warnings = Validator::Testee.sentinel_errors - if warnings.any? + if warnings.any? @output << "\n\nSentinel warnings:\n\n" warnings.each.with_index(1) do |warning,i| @output << colorize("#{i.to_s.rjust(4)}) #{warning.class}\n",:yellow) @@ -67,4 +67,4 @@ def close notification @output << "\n" end end -end \ No newline at end of file +end diff --git a/spec/support/formatters/list.rb b/spec/support/formatters/list.rb index c394ee70..ce19fb77 100644 --- a/spec/support/formatters/list.rb +++ b/spec/support/formatters/list.rb @@ -12,8 +12,8 @@ def example_passed notification # ExampleNotification @output << colorize("#{notification.example.full_description}\n",:success) end - def example_failed notification + def example_failed notification @output << colorize("#{notification.example.full_description}\n",:failure) end end -end \ No newline at end of file +end diff --git a/spec/support/test_site.rb b/spec/support/test_site.rb index db500091..536660b7 100644 --- a/spec/support/test_site.rb +++ b/spec/support/test_site.rb @@ -1,6 +1,6 @@ # Helper class for testing RSMP sites # -# The class is a singleton g class, meaning there will only ever be +# The class is a singleton g class, meaning there will only ever be # one instance. # # The class runs an RSMP supervisor (which the site connects to) @@ -9,10 +9,10 @@ # is maintained across test. # # However, the reactor is paused between tests, to give RSpec a chance -# +# # Only one site is expected to connect to the supervisor. The first # site connecting will be the one that tests communicate with. -# +# # to run. # # Each RSpec test is run inside a separate Async task. @@ -23,7 +23,7 @@ # The class provides a few methods to wait for the site to connect. # These methods all take a block, which is where you should put # you test code. -# +# # RSpec.describe "Traffic Light Controller" do # it 'my test' do |example| # Validator::Site.connected do |task,supervisor,site| @@ -115,4 +115,4 @@ def wait_for_handshake @proxy.wait_for_state :ready, timeout:config['timeouts']['ready'] Validator::Log.log "Ready" end -end \ No newline at end of file +end diff --git a/spec/support/test_supervisor.rb b/spec/support/test_supervisor.rb index 2387e1d1..5eef9dc9 100644 --- a/spec/support/test_supervisor.rb +++ b/spec/support/test_supervisor.rb @@ -1,5 +1,5 @@ # Experimental: -# Helper class for testing RSMP supervisors +# Helper class for testing RSMP supervisors require 'rsmp' require 'singleton' @@ -62,4 +62,4 @@ def wait_for_handshake end end -end \ No newline at end of file +end diff --git a/spec/support/testee.rb b/spec/support/testee.rb index 9baa6026..2868c9fb 100644 --- a/spec/support/testee.rb +++ b/spec/support/testee.rb @@ -6,7 +6,7 @@ require 'colorize' require 'rspec/expectations' -class Validator::Testee +class Validator::Testee include RSpec::Matchers @@sentinel_errors = [] diff --git a/spec/support/validator.rb b/spec/support/validator.rb index 50bb5c5b..23660a99 100644 --- a/spec/support/validator.rb +++ b/spec/support/validator.rb @@ -138,7 +138,7 @@ def self.get_config_path # get config path config_ref = YAML.load_file ref_path config_path = config_ref[self.mode.to_s].to_s.strip - self.abort_with_error "Error: #{ref_path} has no :#{self.mode.to_s} key" unless config_path + self.abort_with_error "Error: #{ref_path} has no :#{self.mode.to_s} key" unless config_path else self.abort_with_error "Error: Neither #{ref_path} nor #{key} is present" unless config_path end diff --git a/yard/code_objects/rspec.rb b/yard/code_objects/rspec.rb index 35b6c00d..204ef981 100644 --- a/yard/code_objects/rspec.rb +++ b/yard/code_objects/rspec.rb @@ -1,5 +1,5 @@ module YARD::CodeObjects - module RSpec + module RSpec class Specs < YARD::CodeObjects::NamespaceObject def type :rspec @@ -7,4 +7,4 @@ def type end RSPEC_NAMESPACE = Specs.new(:root, "Specifications") unless defined?(RSPEC_NAMESPACE) end -end \ No newline at end of file +end diff --git a/yard/code_objects/specification.rb b/yard/code_objects/specification.rb index 6e8cc0a9..8c1936df 100644 --- a/yard/code_objects/specification.rb +++ b/yard/code_objects/specification.rb @@ -24,7 +24,7 @@ def full_name options={} end parts.shift if parts.size > 1 parts.join(' ') - end + end end end end