[rspec-users] stubbing Model.find(id) issues

2011-04-24 Thread Rodrigo Rosenfeld Rosas
I've started a fresh rails app with Employee belongs_to Company. Here is the spec: describe Employee do example "stub should work with find(id)" do company = mock_model Company Company.stub!(:find).with(company.id).and_return company employee = Employee.new company_id: company.id

Re: [rspec-users] stubbing Model.find(id) issues

2011-04-24 Thread David Chelimsky
On Apr 24, 2011, at 9:29 AM, Rodrigo Rosenfeld Rosas wrote: > I've started a fresh rails app with Employee belongs_to Company. > > Here is the spec: > > describe Employee do > example "stub should work with find(id)" do >company = mock_model Company >Company.stub!(:find).with(company.id

[rspec-users] Slow test suite with Ruby 1.9.2 and Rspec 2.5

2011-04-24 Thread Alisson Sales
Hi, I've started a Rails 3 project using Ruby 1.9.2 and Rspec 2 and my test suite is now growing and I'm not happy with the amount of time it is tooking to run. I did a benchmark of it with Ruby Enterprise Edition 1.8.7 2011.03 and it ran much more faster(5x) than Ruby 1.9.2. Is it expected or the

Re: [rspec-users] Slow test suite with Ruby 1.9.2 and Rspec 2.5

2011-04-24 Thread David Chelimsky
On Apr 24, 2011, at 3:24 PM, Alisson Sales wrote: > Hi, I've started a Rails 3 project using Ruby 1.9.2 and Rspec 2 and my > test suite is now growing and I'm not happy with the amount of time it > is tooking to run. I did a benchmark of it with Ruby Enterprise > Edition 1.8.7 2011.03 and it ran m

Re: [rspec-users] Slow test suite with Ruby 1.9.2 and Rspec 2.5

2011-04-24 Thread Alisson Sales
On Sun, Apr 24, 2011 at 5:44 PM, David Chelimsky wrote: > On Apr 24, 2011, at 3:24 PM, Alisson Sales wrote: > >> Hi, I've started a Rails 3 project using Ruby 1.9.2 and Rspec 2 and my >> test suite is now growing and I'm not happy with the amount of time it >> is tooking to run. I did a benchmark

Re: [rspec-users] Slow test suite with Ruby 1.9.2 and Rspec 2.5

2011-04-24 Thread Sidu Ponnappa
Are you perhaps seeing http://is.gd/6aINHC ? We've moved several Rails projects to 1.9.2 over the last few months and we've found our builds running slower on all (we use RSpec too). Cheers, Sidu. http://c42.in http://about.me/ponnappa On 25 April 2011 02:44, Alisson Sales wrote: > On Sun, Apr 2

Re: [rspec-users] Slow test suite with Ruby 1.9.2 and Rspec 2.5

2011-04-24 Thread Sidu Ponnappa
Oh, and it should be sorted in 1.9.3: http://redmine.ruby-lang.org/issues/show/3924 Note that this only impacts startup times - your app should still run faster on 1.9.2. Best, Sidu. http://c42.in http://about.me/ponnappa On 25 April 2011 02:53, Sidu Ponnappa wrote: > Are you perhaps seeing htt

Re: [rspec-users] Slow test suite with Ruby 1.9.2 and Rspec 2.5

2011-04-24 Thread Alisson Sales
On Sun, Apr 24, 2011 at 6:23 PM, Sidu Ponnappa wrote: > Are you perhaps seeing http://is.gd/6aINHC ? We've moved several Rails > projects to 1.9.2 over the last few months and we've found our builds > running slower on all (we use RSpec too). I'm not sure if the problem is the startup time. Does

Re: [rspec-users] stubbing Model.find(id) issues

2011-04-24 Thread Rodrigo Rosenfeld Rosas
Em 24-04-2011 12:09, David Chelimsky escreveu: On Apr 24, 2011, at 9:29 AM, Rodrigo Rosenfeld Rosas wrote: I've started a fresh rails app with Employee belongs_to Company. Here is the spec: describe Employee do example "stub should work with find(id)" do company = mock_model Company

Re: [rspec-users] Slow test suite with Ruby 1.9.2 and Rspec 2.5

2011-04-24 Thread Sidu Ponnappa
Unfortunately I don't have a Rails project handy that builds on both 1.8 and 1.9, but here are the results for a pure Ruby project: https://gist.github.com/939981 As you can see, the build times are nearly identical across 1.8.7, REE, 1.9.2 and 1.9.3-dev (I'm using RSpec 2.6.0.rc2). Are you seein

Re: [rspec-users] Slow test suite with Ruby 1.9.2 and Rspec 2.5

2011-04-24 Thread Rodrigo Rosenfeld Rosas
Em 24-04-2011 19:22, Alisson Sales escreveu: On Sun, Apr 24, 2011 at 6:23 PM, Sidu Ponnappa wrote: Are you perhaps seeing http://is.gd/6aINHC ? We've moved several Rails projects to 1.9.2 over the last few months and we've found our builds running slower on all (we use RSpec too). I'm not sure

Re: [rspec-users] stubbing Model.find(id) issues

2011-04-24 Thread David Chelimsky
On Apr 24, 2011, at 6:25 PM, Rodrigo Rosenfeld Rosas wrote: > Em 24-04-2011 12:09, David Chelimsky escreveu: >> On Apr 24, 2011, at 9:29 AM, Rodrigo Rosenfeld Rosas wrote: >> >>> I've started a fresh rails app with Employee belongs_to Company. >>> >>> Here is the spec: >>> >>> describe Employee