Skip to content

Instantly share code, notes, and snippets.

@AlekSi
Created April 19, 2011 15:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlekSi/928480 to your computer and use it in GitHub Desktop.
Save AlekSi/928480 to your computer and use it in GitHub Desktop.
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