Jeroen Houben
2007-Dec-17 13:13 UTC
[rspec-users] Change in isolation behaviour 1.08 - 1.10 ?
Hi, I just moved from 1.08 to 1.10 and now have one example failing, which, under 1.08, passed. Is the due to a change in behaviour? Here''s my spec (removed some passing examples) require File.dirname(__FILE__) + ''/../spec_helper'' describe "A user" do before(:each) do @user = User.new @valid_user = User.new( :email => ''bert.valid at lostboys.nl'', :fname => ''bert'', :lname => ''valid'', :jobtitle => "programmer" ) end it "should have a unique email address" do @valid_user.save.should == true @user.email = @valid_user.email @user.should have(1).error_on(:email) end it "should allow two users with the same name" do @valid_user.save.should == true @user.fname = @valid_user.fname @user.lname = @valid_user.lname @user.should have(:no).error_on(:fname) @user.should have(:no).error_on(:lname) end end The second example now fails, as the inserted record from the first example is not rolled back. I can just put a User.delete_all in an after(:each) block but I think it would be nicer if Rspec wrapped each example in a db transaction. Wasn''t this they way things worked in 1.08 ? Jeroen
aslak hellesoy
2007-Dec-17 14:17 UTC
[rspec-users] Change in isolation behaviour 1.08 - 1.10 ?
On Dec 17, 2007 2:13 PM, Jeroen Houben <jeroen.houben at lostboys.nl> wrote:> Hi, > > I just moved from 1.08 to 1.10 and now have one example failing, which, > under 1.08, passed. Is the due to a change in behaviour? > > Here''s my spec (removed some passing examples) > > require File.dirname(__FILE__) + ''/../spec_helper'' > > describe "A user" do > > before(:each) do > @user = User.new > @valid_user = User.new( > :email => ''bert.valid at lostboys.nl'', > :fname => ''bert'', > :lname => ''valid'', > :jobtitle => "programmer" > ) > end > > it "should have a unique email address" do > @valid_user.save.should == true > @user.email = @valid_user.email > @user.should have(1).error_on(:email) > end > > it "should allow two users with the same name" do > @valid_user.save.should == true > @user.fname = @valid_user.fname > @user.lname = @valid_user.lname > @user.should have(:no).error_on(:fname) > @user.should have(:no).error_on(:lname) > end > > end > > The second example now fails, as the inserted record from the first example > is not rolled back. >stack trace please> I can just put a User.delete_all in an after(:each) block but I think it > would be nicer if Rspec wrapped each example in a db transaction. Wasn''t > this they way things worked in 1.08 ? > > Jeroen > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
Jeroen Houben
2007-Dec-17 14:23 UTC
[rspec-users] Change in isolation behaviour 1.08 - 1.10 ?
jeroen$ ./script/spec spec/models/user_spec.rb -b ...F..................P.. Pending: A valid user should add the correct error on dob when using an bogus dob assignment (with only a month) (met max dob is beetje lastig op win32 lijkt het :-s) 1) ''A user should allow two users with the same name'' FAILED expected: true, got: false (using ==) /Users/jeroen/lostboys.nl/vendor/plugins/rspec/lib/spec/expectations.rb:52:i n `fail_with'' /Users/jeroen/lostboys.nl/vendor/plugins/rspec/lib/spec/matchers/operator_ma tcher.rb:46:in `fail_with_message'' /Users/jeroen/lostboys.nl/vendor/plugins/rspec/lib/spec/matchers/operator_ma tcher.rb:56:in `__delegate_method_missing_to_target'' /Users/jeroen/lostboys.nl/vendor/plugins/rspec/lib/spec/matchers/operator_ma tcher.rb:12:in `=='' ./spec/models/user_spec.rb:36: /Users/jeroen/lostboys.nl/vendor/plugins/rspec/lib/spec/example/example_meth ods.rb:79:in `instance_eval'' /Users/jeroen/lostboys.nl/vendor/plugins/rspec/lib/spec/example/example_meth ods.rb:79:in `run_with_description_capturing'' /Users/jeroen/lostboys.nl/vendor/plugins/rspec/lib/spec/matchers.rb:144:in `capture_generated_description'' /Users/jeroen/lostboys.nl/vendor/plugins/rspec/lib/spec/example/example_meth ods.rb:78:in `run_with_description_capturing'' /Users/jeroen/lostboys.nl/vendor/plugins/rspec/lib/spec/example/example_meth ods.rb:19:in `execute'' /usr/local/lib/ruby/1.8/timeout.rb:48:in `timeout'' /Users/jeroen/lostboys.nl/vendor/plugins/rspec/lib/spec/example/example_meth ods.rb:16:in `execute'' /Users/jeroen/lostboys.nl/vendor/plugins/rspec/lib/spec/example/example_grou p_methods.rb:280:in `execute_examples'' /Users/jeroen/lostboys.nl/vendor/plugins/rspec/lib/spec/example/example_grou p_methods.rb:279:in `each'' /Users/jeroen/lostboys.nl/vendor/plugins/rspec/lib/spec/example/example_grou p_methods.rb:279:in `execute_examples'' /Users/jeroen/lostboys.nl/vendor/plugins/rspec/lib/spec/example/example_grou p_methods.rb:120:in `run'' /Users/jeroen/lostboys.nl/vendor/plugins/rspec/lib/spec/runner/example_group _runner.rb:22:in `run'' /Users/jeroen/lostboys.nl/vendor/plugins/rspec/lib/spec/runner/example_group _runner.rb:21:in `each'' /Users/jeroen/lostboys.nl/vendor/plugins/rspec/lib/spec/runner/example_group _runner.rb:21:in `run'' /Users/jeroen/lostboys.nl/vendor/plugins/rspec/lib/spec/runner/options.rb:87 :in `run_examples'' /Users/jeroen/lostboys.nl/vendor/plugins/rspec/lib/spec/runner/command_line. rb:19:in `run'' ./script/spec:4: Finished in 0.391897 seconds 25 examples, 1 failure, 1 pending On 12/17/07 3:17 PM, "aslak hellesoy" <aslak.hellesoy at gmail.com> wrote:> On Dec 17, 2007 2:13 PM, Jeroen Houben <jeroen.houben at lostboys.nl> wrote: >> Hi, >> >> I just moved from 1.08 to 1.10 and now have one example failing, which, >> under 1.08, passed. Is the due to a change in behaviour? >> >> Here''s my spec (removed some passing examples) >> >> require File.dirname(__FILE__) + ''/../spec_helper'' >> >> describe "A user" do >> >> before(:each) do >> @user = User.new >> @valid_user = User.new( >> :email => ''bert.valid at lostboys.nl'', >> :fname => ''bert'', >> :lname => ''valid'', >> :jobtitle => "programmer" >> ) >> end >> >> it "should have a unique email address" do >> @valid_user.save.should == true >> @user.email = @valid_user.email >> @user.should have(1).error_on(:email) >> end >> >> it "should allow two users with the same name" do >> @valid_user.save.should == true >> @user.fname = @valid_user.fname >> @user.lname = @valid_user.lname >> @user.should have(:no).error_on(:fname) >> @user.should have(:no).error_on(:lname) >> end >> >> end >> >> The second example now fails, as the inserted record from the first example >> is not rolled back. >> > > stack trace please > >> I can just put a User.delete_all in an after(:each) block but I think it >> would be nicer if Rspec wrapped each example in a db transaction. Wasn''t >> this they way things worked in 1.08 ? >> >> Jeroen >> >> _______________________________________________ >> rspec-users mailing list >> rspec-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/rspec-users >> > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users
aslak hellesoy
2007-Dec-17 14:47 UTC
[rspec-users] Change in isolation behaviour 1.08 - 1.10 ?
On Dec 17, 2007 2:13 PM, Jeroen Houben <jeroen.houben at lostboys.nl> wrote:> Hi, > > I just moved from 1.08 to 1.10 and now have one example failing, which, > under 1.08, passed. Is the due to a change in behaviour? > > Here''s my spec (removed some passing examples) > > require File.dirname(__FILE__) + ''/../spec_helper'' > > describe "A user" do > > before(:each) do > @user = User.new > @valid_user = User.new( > :email => ''bert.valid at lostboys.nl'', > :fname => ''bert'', > :lname => ''valid'', > :jobtitle => "programmer" > ) > end > > it "should have a unique email address" do > @valid_user.save.should == true > @user.email = @valid_user.email > @user.should have(1).error_on(:email) > end > > it "should allow two users with the same name" do > @valid_user.save.should == true > @user.fname = @valid_user.fname > @user.lname = @valid_user.lname > @user.should have(:no).error_on(:fname) > @user.should have(:no).error_on(:lname) > end > > end > > The second example now fails, as the inserted record from the first example > is not rolled back. >I don''t see a fixtures :users in your spec. Do you have this in your spec_helper? Have you rerun script/generate rspec after you upgraded? There are some changes in the spec_helper.rb file between the two releases. Aslak> I can just put a User.delete_all in an after(:each) block but I think it > would be nicer if Rspec wrapped each example in a db transaction. Wasn''t > this they way things worked in 1.08 ? > > Jeroen > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
David Chelimsky
2007-Dec-17 14:50 UTC
[rspec-users] Change in isolation behaviour 1.08 - 1.10 ?
On Dec 17, 2007 8:47 AM, aslak hellesoy <aslak.hellesoy at gmail.com> wrote:> On Dec 17, 2007 2:13 PM, Jeroen Houben <jeroen.houben at lostboys.nl> wrote: > > > Hi, > > > > I just moved from 1.08 to 1.10 and now have one example failing, which, > > under 1.08, passed. Is the due to a change in behaviour? > > > > Here''s my spec (removed some passing examples) > > > > require File.dirname(__FILE__) + ''/../spec_helper'' > > > > describe "A user" do > > > > before(:each) do > > @user = User.new > > @valid_user = User.new( > > :email => ''bert.valid at lostboys.nl'', > > :fname => ''bert'', > > :lname => ''valid'', > > :jobtitle => "programmer" > > ) > > end > > > > it "should have a unique email address" do > > @valid_user.save.should == true > > @user.email = @valid_user.email > > @user.should have(1).error_on(:email) > > end > > > > it "should allow two users with the same name" do > > @valid_user.save.should == true > > @user.fname = @valid_user.fname > > @user.lname = @valid_user.lname > > @user.should have(:no).error_on(:fname) > > @user.should have(:no).error_on(:lname) > > end > > > > end > > > > The second example now fails, as the inserted record from the first example > > is not rolled back. > > > > I don''t see a fixtures :users in your spec. Do you have this in your > spec_helper? > Have you rerun script/generate rspec after you upgraded? There are > some changes in the spec_helper.rb file between the two releases.This is actually a regression in 1.1.0 that has been fixed in trunk. We''ll do a 1.1.1 release later today, but go ahead and update to trunk for the time being and you should be good. Cheers, David> > Aslak > > > > I can just put a User.delete_all in an after(:each) block but I think it > > would be nicer if Rspec wrapped each example in a db transaction. Wasn''t > > this they way things worked in 1.08 ? > > > > Jeroen > > > > _______________________________________________ > > rspec-users mailing list > > rspec-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/rspec-users > > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
Jeroen Houben
2007-Dec-17 14:52 UTC
[rspec-users] Change in isolation behaviour 1.08 - 1.10 ?
> > This is actually a regression in 1.1.0 that has been fixed in trunk. > We''ll do a 1.1.1 release later today, but go ahead and update to trunk > for the time being and you should be good. >Great, thanks. Will I get 1.1.1 automatically if I''m using svn:externals and the CURRENT tag? jeroen
David Chelimsky
2007-Dec-17 14:53 UTC
[rspec-users] Change in isolation behaviour 1.08 - 1.10 ?
On Dec 17, 2007 8:52 AM, Jeroen Houben <jeroen.houben at lostboys.nl> wrote:> > > > This is actually a regression in 1.1.0 that has been fixed in trunk. > > We''ll do a 1.1.1 release later today, but go ahead and update to trunk > > for the time being and you should be good. > > > > Great, thanks. Will I get 1.1.1 automatically if I''m using svn:externals and > the CURRENT tag?When we do the release, yes, but not until then.> > > jeroen > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
Jeroen Houben
2007-Dec-17 14:55 UTC
[rspec-users] Change in isolation behaviour 1.08 - 1.10 ?
> > I don''t see a fixtures :users in your spec. Do you have this in your > spec_helper?Not using fixtures in this particular spec> Have you rerun script/generate rspec after you upgraded?Yes, but manually copied over the changes in spec_helper.rb> There are some changes in the spec_helper.rb file between the two releases.... Just received the message by David. This will be fixed in 1.1.1 Thanks for your help! Jeroen
David Chelimsky
2007-Dec-17 14:58 UTC
[rspec-users] Change in isolation behaviour 1.08 - 1.10 ?
On Dec 17, 2007 8:55 AM, Jeroen Houben <jeroen.houben at lostboys.nl> wrote:> > > > > I don''t see a fixtures :users in your spec. Do you have this in your > > spec_helper? > > Not using fixtures in this particular spec > > > Have you rerun script/generate rspec after you upgraded? > > Yes, but manually copied over the changes in spec_helper.rb > > > There are some changes in the spec_helper.rb file between the two releases. > > ... Just received the message by David. This will be fixed in 1.1.1Jeroen - just for good measure, would you kindly update from trunk and verify that it does in fact fix your issue?> > Thanks for your help! > > > Jeroen > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
Jeroen Houben
2007-Dec-17 15:06 UTC
[rspec-users] Change in isolation behaviour 1.08 - 1.10 ?
>> >> ... Just received the message by David. This will be fixed in 1.1.1 > > Jeroen - just for good measure, would you kindly update from trunk and > verify that it does in fact fix your issue?Finished in 3.42683 seconds 176 examples, 0 failures, 3 pending :)
David Chelimsky
2007-Dec-17 15:12 UTC
[rspec-users] Change in isolation behaviour 1.08 - 1.10 ?
On Dec 17, 2007 9:06 AM, Jeroen Houben <jeroen.houben at lostboys.nl> wrote:> >> > >> ... Just received the message by David. This will be fixed in 1.1.1 > > > > Jeroen - just for good measure, would you kindly update from trunk and > > verify that it does in fact fix your issue? > > Finished in 3.42683 seconds > > 176 examples, 0 failures, 3 pendingThanks. I''ll get the release out by tonight. Cheers, David> > :) > > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
aslak hellesoy
2007-Dec-17 16:55 UTC
[rspec-users] Change in isolation behaviour 1.08 - 1.10 ?
On Dec 17, 2007 4:12 PM, David Chelimsky <dchelimsky at gmail.com> wrote:> On Dec 17, 2007 9:06 AM, Jeroen Houben <jeroen.houben at lostboys.nl> wrote: > > >> > > >> ... Just received the message by David. This will be fixed in 1.1.1 > > > > > > Jeroen - just for good measure, would you kindly update from trunk and > > > verify that it does in fact fix your issue? > > > > Finished in 3.42683 seconds > > > > 176 examples, 0 failures, 3 pending > > Thanks. I''ll get the release out by tonight. >Awesome David. Do we have any specs that will catch this regression if it''s reintroduced? Aslak> Cheers, > David > > > > > > :) > > > > > > _______________________________________________ > > rspec-users mailing list > > rspec-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/rspec-users > > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
David Chelimsky
2007-Dec-17 16:58 UTC
[rspec-users] Change in isolation behaviour 1.08 - 1.10 ?
On Dec 17, 2007 10:55 AM, aslak hellesoy <aslak.hellesoy at gmail.com> wrote:> On Dec 17, 2007 4:12 PM, David Chelimsky <dchelimsky at gmail.com> wrote: > > On Dec 17, 2007 9:06 AM, Jeroen Houben <jeroen.houben at lostboys.nl> wrote: > > > >> > > > >> ... Just received the message by David. This will be fixed in 1.1.1 > > > > > > > > Jeroen - just for good measure, would you kindly update from trunk and > > > > verify that it does in fact fix your issue? > > > > > > Finished in 3.42683 seconds > > > > > > 176 examples, 0 failures, 3 pending > > > > Thanks. I''ll get the release out by tonight. > > > > Awesome David. > > Do we have any specs that will catch this regression if it''s reintroduced?I didn''t look and don''t have time right now. The fix was committed in r3158. Can you check the diff?> > Aslak > > > > Cheers, > > David > > > > > > > > > > :) > > > > > > > > > _______________________________________________ > > > rspec-users mailing list > > > rspec-users at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/rspec-users > > > > > _______________________________________________ > > rspec-users mailing list > > rspec-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/rspec-users > > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
aslak hellesoy
2007-Dec-17 18:14 UTC
[rspec-users] Change in isolation behaviour 1.08 - 1.10 ?
On Dec 17, 2007 5:58 PM, David Chelimsky <dchelimsky at gmail.com> wrote:> On Dec 17, 2007 10:55 AM, aslak hellesoy <aslak.hellesoy at gmail.com> wrote: > > On Dec 17, 2007 4:12 PM, David Chelimsky <dchelimsky at gmail.com> wrote: > > > On Dec 17, 2007 9:06 AM, Jeroen Houben <jeroen.houben at lostboys.nl> wrote: > > > > >> > > > > >> ... Just received the message by David. This will be fixed in 1.1.1 > > > > > > > > > > Jeroen - just for good measure, would you kindly update from trunk and > > > > > verify that it does in fact fix your issue? > > > > > > > > Finished in 3.42683 seconds > > > > > > > > 176 examples, 0 failures, 3 pending > > > > > > Thanks. I''ll get the release out by tonight. > > > > > > > Awesome David. > > > > Do we have any specs that will catch this regression if it''s reintroduced? > > I didn''t look and don''t have time right now. The fix was committed in > r3158. Can you check the diff? >I''ve added some more functional specs (r3172) that should prevent any transaction related bugs from coming back in. Jeroen - if you find more bugs, please report what Rails and Ruby versions you are using - it took me a while to realise that you were on Rails 1.2.3 (David told me)> > > > > Aslak > > > > > > > Cheers, > > > David > > > > > > > > > > > > > > :) > > > > > > > > > > > > _______________________________________________ > > > > rspec-users mailing list > > > > rspec-users at rubyforge.org > > > > http://rubyforge.org/mailman/listinfo/rspec-users > > > > > > > _______________________________________________ > > > rspec-users mailing list > > > rspec-users at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/rspec-users > > > > > _______________________________________________ > > rspec-users mailing list > > rspec-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/rspec-users > > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
Jeroen Houben
2007-Dec-19 15:15 UTC
[rspec-users] Change in isolation behaviour 1.08 - 1.10 ?
On 12/17/07 7:14 PM, "aslak hellesoy" <aslak.hellesoy at gmail.com> wrote:> On Dec 17, 2007 5:58 PM, David Chelimsky <dchelimsky at gmail.com> wrote: >> On Dec 17, 2007 10:55 AM, aslak hellesoy <aslak.hellesoy at gmail.com> wrote: >>> On Dec 17, 2007 4:12 PM, David Chelimsky <dchelimsky at gmail.com> wrote: >>>> On Dec 17, 2007 9:06 AM, Jeroen Houben <jeroen.houben at lostboys.nl> wrote: >>>>>>> >>>>>>> ... Just received the message by David. This will be fixed in 1.1.1 >>>>>> >>>>>> Jeroen - just for good measure, would you kindly update from trunk and >>>>>> verify that it does in fact fix your issue? >>>>> >>>>> Finished in 3.42683 seconds >>>>> >>>>> 176 examples, 0 failures, 3 pending >>>> >>>> Thanks. I''ll get the release out by tonight. >>>> >>> >>> Awesome David. >>> >>> Do we have any specs that will catch this regression if it''s reintroduced? >> >> I didn''t look and don''t have time right now. The fix was committed in >> r3158. Can you check the diff? >> > > I''ve added some more functional specs (r3172) that should prevent any > transaction related bugs from coming back in. > > Jeroen - if you find more bugs, please report what Rails and Ruby > versions you are using - it took me a while to realise that you were > on Rails 1.2.3 (David told me)Don''t know if it makes a difference, but I was on 1.2.6 Cheers, Jeroen