Skip to content
View profile.rb
require 'minitest/autorun'
class FooTest < Minitest::Test
def self.profile name
define_method("test_profile_#{name}") do
# start timer
10.times { send name }
# end timer
if performace_regresses
flunk "you failed"
View test.rb
require 'sprockets'
require 'stackprof'
require 'tmpdir'
require 'fileutils'
require 'allocation_tracer'
require 'minitest/autorun'
Class.new(Minitest::Test) do
attr_reader :path, :environment, :env, :n
View wat.diff
diff --git a/vmdb/app/views/ems_cloud/new.html.haml b/vmdb/app/views/ems_cloud/new.html.haml
index 4752693..62a40f9 100644
--- a/vmdb/app/views/ems_cloud/new.html.haml
+++ b/vmdb/app/views/ems_cloud/new.html.haml
@@ -1 +1,2 @@
-= render :partial => "shared/views/ems_common/form"
+= form_for(@ems) do |f|
+ = render :partial => "shared/views/ems_common/form"
diff --git a/vmdb/config/routes.rb b/vmdb/config/routes.rb
index 8671d42..632fe8e 100644
View mt_complete.rb
#!/usr/bin/env ruby --disable-gems
# Tab completion for minitest tests.
#
# INSTALLATION:
#
# 1. Put this file in a directory in your $PATH. Make sure it's executable
# 2. Run this:
#
# $ complete -o bashdefault -f -C /path/to/this/file.rb ruby
View omg.rb
require 'active_record'
require 'minitest/autorun'
ActiveRecord::Base.establish_connection adapter: 'sqlite3', database: ':memory:'
ActiveRecord::Base.connection.instance_eval do
create_table(:users) do |t|
t.string :name
t.timestamps
end
View gist:762f5d567096a3f98340
/Users/aaron/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/bundler/gems/rails-8f014fba21f9/actionpack/lib/action_controller/metal/params_wrapper.rb:207:in `process_action'
/Users/aaron/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/bundler/gems/rails-8f014fba21f9/activerecord/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
/Users/aaron/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/bundler/gems/rails-8f014fba21f9/actionpack/lib/abstract_controller/base.rb:121:in `process'
/Users/aaron/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/bundler/gems/rails-8f014fba21f9/actionpack/lib/abstract_controller/rendering.rb:45:in `process'
/Users/aaron/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/bundler/gems/rails-8f014fba21f9/actionpack/lib/action_controller/metal/testing.rb:17:in `process_with_new_base_test'
/Users/aaron/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/bundler/gems/rails-8f014fba21f9/actionpack/lib/action_controller/test_case.rb:490:in `process'
/Users/aaron/.rbenv/versions/2.0.0
View url_for_benchmark.rb
require 'abstract_controller/railties/routes_helpers'
require 'action_controller'
require 'action_controller/railties/helpers'
require 'action_view'
require 'action_dispatch'
require 'active_record'
ActiveRecord::Base.establish_connection adapter: "sqlite3", database: ":memory:"
ActiveRecord::Base.connection.instance_eval do
View create.rb
require 'active_record'
ActiveRecord::Base.establish_connection adapter: "sqlite3", database: ":memory:"
class Article < ActiveRecord::Base
has_one :comment
end
class Comment < ActiveRecord::Base
validates :amazing, presence: true
View whattorun.rb
require 'rugged'
require 'set'
require 'json'
require 'shellwords'
repo = Rugged::Repository.new '.'
lines_to_run = Set.new
repo.index.diff.each_patch { |patch|
delta = patch.delta
View cov.rb
require 'coverage'
require 'json'
Coverage.start
require 'minitest'
module America
LOGS = []
Something went wrong with that request. Please try again.