Created
August 29, 2011 18:36
-
-
Save iain/1179069 to your computer and use it in GitHub Desktop.
slow test example
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
class User < ActiveRecord::Base | |
def name | |
"#{first_name} #{last_name}" | |
end | |
end |
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
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 |
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
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