rubyx/test/fragments/test_recursive_fibo.rb

28 lines
439 B
Ruby
Raw Normal View History

require_relative 'helper'
class TestRecursinveFibo < MiniTest::Test
include Fragments
def test_recursive_fibo
@string_input = <<HERE
def fibonaccir( n )
if( n <= 1 )
2015-07-19 12:31:13 +02:00
return n
else
2015-07-19 12:31:13 +02:00
a = fibonaccir( n - 1 )
b = fibonaccir( n - 2 )
return a + b
end
2014-06-07 23:56:40 +02:00
end
def fib_print(n)
fib = fibonaccir( n )
fib.putint()
end
fib_print(10)
HERE
2015-07-19 12:31:13 +02:00
@expect = [Virtual::Return ]
check
end
end