From 8898d7cbf58bf42030c158ba770c4ca2fdefddae Mon Sep 17 00:00:00 2001 From: Andy Meneely Date: Mon, 3 Nov 2014 22:57:31 -0500 Subject: [PATCH] Unit testing rotate and angle --- spec/input_helpers_spec.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/spec/input_helpers_spec.rb b/spec/input_helpers_spec.rb index e176c68..585417f 100644 --- a/spec/input_helpers_spec.rb +++ b/spec/input_helpers_spec.rb @@ -119,4 +119,20 @@ describe Squib::InputHelpers do end end + context '#rotateify' do + it 'computes a clockwise rotate properly' do + opts = @deck.send(:rotateify, {rotate: :clockwise}) + expect(opts).to eq({ :angle => 0.5 * Math::PI, + :rotate => :clockwise + }) + end + + it 'computes a counter-clockwise rotate properly' do + opts = @deck.send(:rotateify, {rotate: :counterclockwise}) + expect(opts).to eq({ :angle => 1.5 * Math::PI, + :rotate => :counterclockwise + }) + end + end + end