Created
May 14, 2014 00:17
-
-
Save YanhaoYang/3e14f30ee86f2ce753ae to your computer and use it in GitHub Desktop.
code, tests and command line, all in one file
This file contains hidden or 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
# main logic | |
def hi | |
'hi' | |
end | |
# rspec tests | |
require 'rspec' | |
describe "hi" do | |
it "says 'hi'" do | |
hi.should == 'hi' | |
end | |
end | |
# command line | |
if __FILE__ == $0 | |
puts hi | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment