From d1cc482f8fcc02b1b5627f7f468a35f5e1455775 Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Fri, 1 Jun 2018 19:13:53 +0300 Subject: [PATCH] bit of test refactoring --- test/risc/position/helper.rb | 11 +++++++++++ test/risc/position/test_code_position.rb | 2 +- test/risc/position/test_instruction_position.rb | 2 +- test/risc/position/test_object_listener.rb | 7 +------ test/risc/position/test_object_position.rb | 2 +- test/risc/position/test_position.rb | 2 +- 6 files changed, 16 insertions(+), 10 deletions(-) create mode 100644 test/risc/position/helper.rb diff --git a/test/risc/position/helper.rb b/test/risc/position/helper.rb new file mode 100644 index 00000000..026cc2ca --- /dev/null +++ b/test/risc/position/helper.rb @@ -0,0 +1,11 @@ +require_relative "../helper" + +module Risc + module Position + class Dummy + def padded_length + 4 + end + end + end +end diff --git a/test/risc/position/test_code_position.rb b/test/risc/position/test_code_position.rb index 70e941ba..377d8175 100644 --- a/test/risc/position/test_code_position.rb +++ b/test/risc/position/test_code_position.rb @@ -1,4 +1,4 @@ -require_relative "../helper" +require_relative "helper" module Risc # tests that require a boot and test propagation diff --git a/test/risc/position/test_instruction_position.rb b/test/risc/position/test_instruction_position.rb index 6dadabbf..469b7b31 100644 --- a/test/risc/position/test_instruction_position.rb +++ b/test/risc/position/test_instruction_position.rb @@ -1,4 +1,4 @@ -require_relative "../helper" +require_relative "helper" module Risc module Position diff --git a/test/risc/position/test_object_listener.rb b/test/risc/position/test_object_listener.rb index 8a951bc5..915b812d 100644 --- a/test/risc/position/test_object_listener.rb +++ b/test/risc/position/test_object_listener.rb @@ -1,12 +1,7 @@ -require_relative "../helper" +require_relative "helper" module Risc module Position - class Dummy - def padded_length - 4 - end - end class TestObjectListener < MiniTest::Test def setup diff --git a/test/risc/position/test_object_position.rb b/test/risc/position/test_object_position.rb index c5788cdb..d2879613 100644 --- a/test/risc/position/test_object_position.rb +++ b/test/risc/position/test_object_position.rb @@ -1,4 +1,4 @@ -require_relative "../helper" +require_relative "helper" module Risc module Position diff --git a/test/risc/position/test_position.rb b/test/risc/position/test_position.rb index 01431945..933fada4 100644 --- a/test/risc/position/test_position.rb +++ b/test/risc/position/test_position.rb @@ -1,4 +1,4 @@ -require_relative "../helper" +require_relative "helper" module Risc class TestMachinePositions < MiniTest::Test