From 36dfc1b1d3b52361b59fdda5ea8a384b3d4e73ba Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Thu, 15 Dec 2016 22:15:20 +0200 Subject: [PATCH] some positioning tests --- test/register/test_positioning.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/register/test_positioning.rb b/test/register/test_positioning.rb index 9775a2e8..4b284229 100644 --- a/test/register/test_positioning.rb +++ b/test/register/test_positioning.rb @@ -1,5 +1,9 @@ require_relative "../helper" +class TestPosition + include Positioned +end + class TestPositioning < MiniTest::Test def setup Register.machine.boot unless Register.machine.booted @@ -24,4 +28,17 @@ class TestPositioning < MiniTest::Test word = Parfait::Word.new(12) assert_equal 32 , word.padded_length end + def test_raises_no_init + assert_raises { TestPosition.new.position} + end + def test_raises_set_nil + assert_raises { TestPosition.new.position = nil} + end + def test_raises_reset_far + assert_raises do + test = TestPosition.new + test.position = 0 + test.position = 12000 + end + end end