Skip to content

Instantly share code, notes, and snippets.

@iain
Created August 29, 2011 18:36
Show Gist options
  • Save iain/1179069 to your computer and use it in GitHub Desktop.
Save iain/1179069 to your computer and use it in GitHub Desktop.
slow test example
class User < ActiveRecord::Base
def name
"#{first_name} #{last_name}"
end
end
I run a 2.3GHz Macbook Pro with SSD, and a patched version of Ruby 1.9.2 (optimized require and ree-style GC tuning).
Using Rails 3.0.11 and sqlite3.
$ rspec spec/models/user_spec.rb -p -fd
User
has a name
Top 1 slowest examples:
User has a name
0.01519 seconds ./spec/models/user_spec.rb:5
Finished in 0.01549 seconds
1 example, 0 failures
require 'spec_helper'
describe User do
it "has a name" do
subject.first_name = "first"
subject.last_name = "last"
subject.name.should == "first last"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment