Created
April 19, 2011 15:35
-
-
Save AlekSi/928480 to your computer and use it in GitHub Desktop.
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
puts "\n#{RUBY_ENGINE} #{RUBY_VERSION}:" | |
def run_tests | |
[ | |
"now.strftime('%L')", | |
"now.strftime('%N')", | |
"now.strftime('%Q')", | |
"now.to_datetime.strftime('%L')", | |
"now.to_datetime.strftime('%N')", | |
"now.to_datetime.strftime('%Q')", | |
"now.usec.to_s" | |
].each do |e| | |
begin | |
now = Time.at(1303223490.777777) | |
print "\t\t#{e} # => " | |
res = eval(e) | |
print res | |
res.start_with?("777") ? puts(' => \o/') : puts(" => :'(") | |
rescue NoMethodError => e | |
puts "no method => :'(" | |
end | |
end | |
end | |
puts "\tnative:" | |
run_tests | |
require 'rubygems' | |
puts "\tactive_support:" | |
gem 'activesupport', '~> 3.0.7' | |
require 'active_support' | |
run_tests | |
puts "\thome_run:" | |
require 'home_run' | |
run_tests |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment