Unit testing rotate and angle

dev
Andy Meneely 2014-11-03 22:57:31 -05:00
parent d4f0105785
commit 8898d7cbf5
1 changed files with 16 additions and 0 deletions

View File

@ -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