require "test_helper" class SungemmTest < MiniTest::Unit::TestCase def test_fibo_finder assert_equal 0, Sungemm.fibo_finder(0) assert_equal 1, Sungemm.fibo_finder(1) assert_equal 3, Sungemm.fibo_finder(4) assert_equal 13, Sungemm.fibo_finder(7) assert_equal 55, Sungemm.fibo_finder(10) end def test_stack stack = Sungemm::Stack.new([5, 6, 7, 8]) assert_equal stack.pop, 8 assert_equal stack.pop, 7 assert_equal stack.push([4, 2]), true assert_equal stack.pop(3), [2, 4, 6] assert_equal stack.to_a, [5] end def test_queue queue = Sungemm::Queue.new([5, 6, 7, 8]) assert_equal queue.pop, 5 assert_equal queue.pop, 6 assert_equal queue.push([4, 2]), true assert_equal queue.pop(2), [7, 8] assert_equal queue.to_a, [4, 2] end end