Tests build confidence. Write 'em. They'll save your ass, and they'll let you take a chainsaw to your code without being afraid of unintended consequences.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'benchmark' | |
def fibo(n) | |
x,y = 0,1 | |
n.times do | |
x,y = y,x+y | |
end | |
end | |
number = 100_000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# file1 | |
namespace Yehuda | |
class String | |
def printout | |
puts self | |
end | |
end |