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
defmodule Geom do | |
def area(width, length) do | |
width * length | |
end | |
end |
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 'minitest/autorun' | |
begin | |
require_relative 'hello_world' | |
rescue LoadError => e | |
puts "\n\n#{e.backtrace.first} #{e.message}" | |
puts DATA.read | |
exit 1 | |
end | |
class HelloWorldTest < Minitest::Test |
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
class HelloWorld | |
def initialize(name = "World") | |
@name = name | |
end | |
def hello | |
puts "Hello #{@name}!" | |
end | |
end |