Timo Rößner
2010-Jun-28 15:00 UTC
[rspec-users] rspec 2 not cleaning up after examples run?
Hey guys, I let the code speak for itself: Below are my currently failing specs, please don''t pay too much attention to the specs themselves, I just want to give you a "real life example" of what''s happening - the only interesting thing about the specs is that there is a call to Factory(:challenge) in each of them and a before-each-call putting out what''s currently in the database: describe ''featuring'' do before(:each) do puts "Before Each:" puts "Featured Challenges size: #{Challenge.featured.size}" puts "Challenges count: #{Challenge.count}" end it ''should tell if a challenge is featured'' do challenge = Factory(:challenge, :feature_position => 1) challenge.should be_featured end it ''should tell if a challenge is not featured'' do challenge = Factory(:challenge, :feature_position => 0) challenge.should_not be_featured end it ''should feature a challenge'' do challenge = Factory(:challenge) challenge.feature! Challenge.featured.should == [challenge] end it ''should unfeature a challenge'' do challenge = Factory(:challenge, :feature_position => 1) challenge.unfeature! Challenge.featured.should be_empty end end Now to the interesting part: A spec run using rails 2.3.5 and rspec 1: bundle exec spec spec/models/challenge_spec.rb Before Each: Featured Challenges size: 0 Challenges count: 0 .Before Each: Featured Challenges size: 0 Challenges count: 0 .Before Each: Featured Challenges size: 0 Challenges count: 0 .Before Each: Featured Challenges size: 0 Challenges count: 0 .............................. -> Looks good. Here''s the exact same spec run with rspec-2.0.0.beta.13 and rails-3.0.0.beta4: Before Each: Featured Challenges size: 0 Challenges count: 0 Before Each: Featured Challenges size: 1 Challenges count: 1 .Before Each: Featured Challenges size: 1 Challenges count: 2 Before Each: Featured Challenges size: 2 Challenges count: 3 So apparently the latest rspec doesn''t clean up after examples at all? Is this a bug or a feature?
David Chelimsky
2010-Jun-28 15:03 UTC
[rspec-users] rspec 2 not cleaning up after examples run?
On Jun 28, 2010, at 10:00 AM, Timo R??ner wrote:> Hey guys, > > I let the code speak for itself: > > Below are my currently failing specs, please don''t pay too much > attention to the specs themselves, I just want to give you a "real > life example" of what''s happening - the only interesting thing about > the specs is that there is a call to Factory(:challenge) in each of > them and a before-each-call putting out what''s currently in the > database: > > describe ''featuring'' do > > before(:each) do > puts "Before Each:" > puts "Featured Challenges size: #{Challenge.featured.size}" > puts "Challenges count: #{Challenge.count}" > end > > it ''should tell if a challenge is featured'' do > challenge = Factory(:challenge, :feature_position => 1) > challenge.should be_featured > end > > it ''should tell if a challenge is not featured'' do > challenge = Factory(:challenge, :feature_position => 0) > challenge.should_not be_featured > end > > it ''should feature a challenge'' do > challenge = Factory(:challenge) > challenge.feature! > Challenge.featured.should == [challenge] > end > > it ''should unfeature a challenge'' do > challenge = Factory(:challenge, :feature_position => 1) > challenge.unfeature! > Challenge.featured.should be_empty > end > end > > Now to the interesting part: > > A spec run using rails 2.3.5 and rspec 1: > > bundle exec spec spec/models/challenge_spec.rb > Before Each: > Featured Challenges size: 0 > Challenges count: 0 > .Before Each: > Featured Challenges size: 0 > Challenges count: 0 > .Before Each: > Featured Challenges size: 0 > Challenges count: 0 > .Before Each: > Featured Challenges size: 0 > Challenges count: 0 > .............................. > > -> Looks good. > > Here''s the exact same spec run with rspec-2.0.0.beta.13 and > rails-3.0.0.beta4: > > Before Each: > Featured Challenges size: 0 > Challenges count: 0 > Before Each: > Featured Challenges size: 1 > Challenges count: 1 > .Before Each: > Featured Challenges size: 1 > Challenges count: 2 > Before Each: > Featured Challenges size: 2 > Challenges count: 3 > > So apparently the latest rspec doesn''t clean up after examples at all? > > Is this a bug or a feature?Bug, but please check if it''s still true of beta.14.1. Thx
Timo Rößner
2010-Jun-28 15:30 UTC
[rspec-users] rspec 2 not cleaning up after examples run?
Hey David, I just tried it out using the latest rspec and rspec-rails: Gemfile: gem ''rspec'', ''2.0.0.beta.14'' gem ''rspec-rails'', ''2.0.0.beta.14.1 $ bundle show rspec ~/.bundle/ruby/1.8/gems/rspec-2.0.0.beta.14 $bundle show rspec-rails ~/.bundle/ruby/1.8/gems/rspec-rails-2.0.0.beta.14.1 Unfortunately, the bug still exists when using this configuration: Before Each: Featured Challenges size: 0 Challenges count: 0 .Before Each: Featured Challenges size: 1 Challenges count: 1 .Before Each: Featured Challenges size: 1 Challenges count: 2 FBefore Each: Featured Challenges size: 2 Challenges count: 3 On Jun 28, 5:03?pm, David Chelimsky <dchelim... at gmail.com> wrote:> On Jun 28, 2010, at 10:00 AM, Timo R??ner wrote: > > > > > Hey guys, > > > I let the code speak for itself: > > > Below are my currently failing specs, please don''t pay too much > > attention to the specs themselves, I just want to give you a "real > > life example" of what''s happening - the only interesting thing about > > the specs is that there is a call to Factory(:challenge) in each of > > them and a before-each-call putting out what''s currently in the > > database: > > > ?describe ''featuring'' do > > > ? ?before(:each) do > > ? ? ?puts "Before Each:" > > ? ? ?puts "Featured Challenges size: #{Challenge.featured.size}" > > ? ? ?puts "Challenges count: #{Challenge.count}" > > ? ?end > > > ? ?it ''should tell if a challenge is featured'' do > > ? ? ?challenge = Factory(:challenge, :feature_position => 1) > > ? ? ?challenge.should be_featured > > ? ?end > > > ? ?it ''should tell if a challenge is not featured'' do > > ? ? ?challenge = Factory(:challenge, :feature_position => 0) > > ? ? ?challenge.should_not be_featured > > ? ?end > > > ? ?it ''should feature a challenge'' do > > ? ? ?challenge = Factory(:challenge) > > ? ? ?challenge.feature! > > ? ? ?Challenge.featured.should == [challenge] > > ? ?end > > > ? ?it ''should unfeature a challenge'' do > > ? ? ?challenge = Factory(:challenge, :feature_position => 1) > > ? ? ?challenge.unfeature! > > ? ? ?Challenge.featured.should be_empty > > ? ?end > > ?end > > > Now to the interesting part: > > > A spec run using rails 2.3.5 and rspec 1: > > > bundle exec spec spec/models/challenge_spec.rb > > Before Each: > > Featured Challenges size: 0 > > Challenges count: 0 > > .Before Each: > > Featured Challenges size: 0 > > Challenges count: 0 > > .Before Each: > > Featured Challenges size: 0 > > Challenges count: 0 > > .Before Each: > > Featured Challenges size: 0 > > Challenges count: 0 > > .............................. > > > -> Looks good. > > > Here''s the exact same spec run with rspec-2.0.0.beta.13 and > > rails-3.0.0.beta4: > > > Before Each: > > Featured Challenges size: 0 > > Challenges count: 0 > > Before Each: > > Featured Challenges size: 1 > > Challenges count: 1 > > .Before Each: > > Featured Challenges size: 1 > > Challenges count: 2 > > Before Each: > > Featured Challenges size: 2 > > Challenges count: 3 > > > So apparently the latest rspec doesn''t clean up after examples at all? > > > Is this a bug or a feature? > > Bug, but please check if it''s still true of beta.14.1. > > Thx > _______________________________________________ > rspec-users mailing list > rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users
David Chelimsky
2010-Jun-28 15:35 UTC
[rspec-users] rspec 2 not cleaning up after examples run?
On Jun 28, 2010, at 10:30 AM, Timo R??ner wrote:> On Jun 28, 5:03 pm, David Chelimsky <dchelim... at gmail.com> wrote: >> On Jun 28, 2010, at 10:00 AM, Timo R??ner wrote: >> >> >> >>> Hey guys, >> >>> I let the code speak for itself: >> >>> Below are my currently failing specs, please don''t pay too much >>> attention to the specs themselves, I just want to give you a "real >>> life example" of what''s happening - the only interesting thing about >>> the specs is that there is a call to Factory(:challenge) in each of >>> them and a before-each-call putting out what''s currently in the >>> database: >> >>> describe ''featuring'' do >> >>> before(:each) do >>> puts "Before Each:" >>> puts "Featured Challenges size: #{Challenge.featured.size}" >>> puts "Challenges count: #{Challenge.count}" >>> end >> >>> it ''should tell if a challenge is featured'' do >>> challenge = Factory(:challenge, :feature_position => 1) >>> challenge.should be_featured >>> end >> >>> it ''should tell if a challenge is not featured'' do >>> challenge = Factory(:challenge, :feature_position => 0) >>> challenge.should_not be_featured >>> end >> >>> it ''should feature a challenge'' do >>> challenge = Factory(:challenge) >>> challenge.feature! >>> Challenge.featured.should == [challenge] >>> end >> >>> it ''should unfeature a challenge'' do >>> challenge = Factory(:challenge, :feature_position => 1) >>> challenge.unfeature! >>> Challenge.featured.should be_empty >>> end >>> end >> >>> Now to the interesting part: >> >>> A spec run using rails 2.3.5 and rspec 1: >> >>> bundle exec spec spec/models/challenge_spec.rb >>> Before Each: >>> Featured Challenges size: 0 >>> Challenges count: 0 >>> .Before Each: >>> Featured Challenges size: 0 >>> Challenges count: 0 >>> .Before Each: >>> Featured Challenges size: 0 >>> Challenges count: 0 >>> .Before Each: >>> Featured Challenges size: 0 >>> Challenges count: 0 >>> .............................. >> >>> -> Looks good. >> >>> Here''s the exact same spec run with rspec-2.0.0.beta.13 and >>> rails-3.0.0.beta4: >> >>> Before Each: >>> Featured Challenges size: 0 >>> Challenges count: 0 >>> Before Each: >>> Featured Challenges size: 1 >>> Challenges count: 1 >>> .Before Each: >>> Featured Challenges size: 1 >>> Challenges count: 2 >>> Before Each: >>> Featured Challenges size: 2 >>> Challenges count: 3 >> >>> So apparently the latest rspec doesn''t clean up after examples at all? >> >>> Is this a bug or a feature? >> >> Bug, but please check if it''s still true of beta.14.1. >> > Hey David, > > I just tried it out using the latest rspec and rspec-rails: > > Gemfile: > > gem ''rspec'', ''2.0.0.beta.14'' > gem ''rspec-rails'', ''2.0.0.beta.14.1 > > $ bundle show rspec > ~/.bundle/ruby/1.8/gems/rspec-2.0.0.beta.14 > > $bundle show rspec-rails > ~/.bundle/ruby/1.8/gems/rspec-rails-2.0.0.beta.14.1 > > Unfortunately, the bug still exists when using this configuration: > > Before Each: > Featured Challenges size: 0 > Challenges count: 0 > .Before Each: > Featured Challenges size: 1 > Challenges count: 1 > .Before Each: > Featured Challenges size: 1 > Challenges count: 2 > FBefore Each: > Featured Challenges size: 2 > Challenges count: 3What''s in your Gemfile and spec/spec_helper.rb? ps - please post in-line or at the bottom so we can follow the thread.
Timo Rößner
2010-Jun-29 07:50 UTC
[rspec-users] rspec 2 not cleaning up after examples run?
Hi David, Gemfile and spec/spec_helper (not sure what you mean with "in-line posting"? I hope it''s ok like that, if not, let me know): -> http://gist.github.com/456941 On Jun 28, 5:35?pm, David Chelimsky <dchelim... at gmail.com> wrote:> On Jun 28, 2010, at 10:30 AM, Timo R??ner wrote: > > > > > On Jun 28, 5:03 pm, David Chelimsky <dchelim... at gmail.com> wrote: > >> On Jun 28, 2010, at 10:00 AM, Timo R??ner wrote: > > >>> Hey guys, > > >>> I let the code speak for itself: > > >>> Below are my currently failing specs, please don''t pay too much > >>> attention to the specs themselves, I just want to give you a "real > >>> life example" of what''s happening - the only interesting thing about > >>> the specs is that there is a call to Factory(:challenge) in each of > >>> them and a before-each-call putting out what''s currently in the > >>> database: > > >>> ?describe ''featuring'' do > > >>> ? ?before(:each) do > >>> ? ? ?puts "Before Each:" > >>> ? ? ?puts "Featured Challenges size: #{Challenge.featured.size}" > >>> ? ? ?puts "Challenges count: #{Challenge.count}" > >>> ? ?end > > >>> ? ?it ''should tell if a challenge is featured'' do > >>> ? ? ?challenge = Factory(:challenge, :feature_position => 1) > >>> ? ? ?challenge.should be_featured > >>> ? ?end > > >>> ? ?it ''should tell if a challenge is not featured'' do > >>> ? ? ?challenge = Factory(:challenge, :feature_position => 0) > >>> ? ? ?challenge.should_not be_featured > >>> ? ?end > > >>> ? ?it ''should feature a challenge'' do > >>> ? ? ?challenge = Factory(:challenge) > >>> ? ? ?challenge.feature! > >>> ? ? ?Challenge.featured.should == [challenge] > >>> ? ?end > > >>> ? ?it ''should unfeature a challenge'' do > >>> ? ? ?challenge = Factory(:challenge, :feature_position => 1) > >>> ? ? ?challenge.unfeature! > >>> ? ? ?Challenge.featured.should be_empty > >>> ? ?end > >>> ?end > > >>> Now to the interesting part: > > >>> A spec run using rails 2.3.5 and rspec 1: > > >>> bundle exec spec spec/models/challenge_spec.rb > >>> Before Each: > >>> Featured Challenges size: 0 > >>> Challenges count: 0 > >>> .Before Each: > >>> Featured Challenges size: 0 > >>> Challenges count: 0 > >>> .Before Each: > >>> Featured Challenges size: 0 > >>> Challenges count: 0 > >>> .Before Each: > >>> Featured Challenges size: 0 > >>> Challenges count: 0 > >>> .............................. > > >>> -> Looks good. > > >>> Here''s the exact same spec run with rspec-2.0.0.beta.13 and > >>> rails-3.0.0.beta4: > > >>> Before Each: > >>> Featured Challenges size: 0 > >>> Challenges count: 0 > >>> Before Each: > >>> Featured Challenges size: 1 > >>> Challenges count: 1 > >>> .Before Each: > >>> Featured Challenges size: 1 > >>> Challenges count: 2 > >>> Before Each: > >>> Featured Challenges size: 2 > >>> Challenges count: 3 > > >>> So apparently the latest rspec doesn''t clean up after examples at all? > > >>> Is this a bug or a feature? > > >> Bug, but please check if it''s still true of beta.14.1. > > > Hey David, > > > I just tried it out using the latest rspec and rspec-rails: > > > Gemfile: > > > ?gem ''rspec'', ''2.0.0.beta.14'' > > ?gem ''rspec-rails'', ''2.0.0.beta.14.1 > > > $ bundle show rspec > > ~/.bundle/ruby/1.8/gems/rspec-2.0.0.beta.14 > > > $bundle show rspec-rails > > ~/.bundle/ruby/1.8/gems/rspec-rails-2.0.0.beta.14.1 > > > Unfortunately, the bug still exists when using this configuration: > > > Before Each: > > Featured Challenges size: 0 > > Challenges count: 0 > > .Before Each: > > Featured Challenges size: 1 > > Challenges count: 1 > > .Before Each: > > Featured Challenges size: 1 > > Challenges count: 2 > > FBefore Each: > > Featured Challenges size: 2 > > Challenges count: 3 > > What''s in your Gemfile and spec/spec_helper.rb? > > ps - please post in-line or at the bottom so we can follow the thread. > _______________________________________________ > rspec-users mailing list > rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users
Wincent Colaiuta
2010-Jun-29 07:55 UTC
[rspec-users] rspec 2 not cleaning up after examples run?
El 29/06/2010, a las 09:50, Timo R??ner escribi?:> Hi David, > > Gemfile and spec/spec_helper (not sure what you mean with "in-line > posting"? I hope it''s ok like that, if not, let me know):He means, don''t top-post. http://idallen.com/topposting.html http://en.wikipedia.org/wiki/Posting_style#Top-posting Cheers, Wincent
David Chelimsky
2010-Jun-29 10:14 UTC
[rspec-users] rspec 2 not cleaning up after examples run?
On Jun 29, 2010, at 2:50 AM, Timo R??ner wrote:> On Jun 28, 5:35 pm, David Chelimsky <dchelim... at gmail.com> wrote: >> On Jun 28, 2010, at 10:30 AM, Timo R??ner wrote: >>> On Jun 28, 5:03 pm, David Chelimsky <dchelim... at gmail.com> wrote: >>>> On Jun 28, 2010, at 10:00 AM, Timo R??ner wrote: >> >>>>> Hey guys, >> >>>>> I let the code speak for itself: >> >>>>> Below are my currently failing specs, please don''t pay too much >>>>> attention to the specs themselves, I just want to give you a "real >>>>> life example" of what''s happening - the only interesting thing about >>>>> the specs is that there is a call to Factory(:challenge) in each of >>>>> them and a before-each-call putting out what''s currently in the >>>>> database: >> >>>>> describe ''featuring'' do >> >>>>> before(:each) do >>>>> puts "Before Each:" >>>>> puts "Featured Challenges size: #{Challenge.featured.size}" >>>>> puts "Challenges count: #{Challenge.count}" >>>>> end >> >>>>> it ''should tell if a challenge is featured'' do >>>>> challenge = Factory(:challenge, :feature_position => 1) >>>>> challenge.should be_featured >>>>> end >> >>>>> it ''should tell if a challenge is not featured'' do >>>>> challenge = Factory(:challenge, :feature_position => 0) >>>>> challenge.should_not be_featured >>>>> end >> >>>>> it ''should feature a challenge'' do >>>>> challenge = Factory(:challenge) >>>>> challenge.feature! >>>>> Challenge.featured.should == [challenge] >>>>> end >> >>>>> it ''should unfeature a challenge'' do >>>>> challenge = Factory(:challenge, :feature_position => 1) >>>>> challenge.unfeature! >>>>> Challenge.featured.should be_empty >>>>> end >>>>> end >> >>>>> Now to the interesting part: >> >>>>> A spec run using rails 2.3.5 and rspec 1: >> >>>>> bundle exec spec spec/models/challenge_spec.rb >>>>> Before Each: >>>>> Featured Challenges size: 0 >>>>> Challenges count: 0 >>>>> .Before Each: >>>>> Featured Challenges size: 0 >>>>> Challenges count: 0 >>>>> .Before Each: >>>>> Featured Challenges size: 0 >>>>> Challenges count: 0 >>>>> .Before Each: >>>>> Featured Challenges size: 0 >>>>> Challenges count: 0 >>>>> .............................. >> >>>>> -> Looks good. >> >>>>> Here''s the exact same spec run with rspec-2.0.0.beta.13 and >>>>> rails-3.0.0.beta4: >> >>>>> Before Each: >>>>> Featured Challenges size: 0 >>>>> Challenges count: 0 >>>>> Before Each: >>>>> Featured Challenges size: 1 >>>>> Challenges count: 1 >>>>> .Before Each: >>>>> Featured Challenges size: 1 >>>>> Challenges count: 2 >>>>> Before Each: >>>>> Featured Challenges size: 2 >>>>> Challenges count: 3 >> >>>>> So apparently the latest rspec doesn''t clean up after examples at all? >> >>>>> Is this a bug or a feature? >> >>>> Bug, but please check if it''s still true of beta.14.1. >> >>> Hey David, >> >>> I just tried it out using the latest rspec and rspec-rails: >> >>> Gemfile: >> >>> gem ''rspec'', ''2.0.0.beta.14'' >>> gem ''rspec-rails'', ''2.0.0.beta.14.1 >> >>> $ bundle show rspec >>> ~/.bundle/ruby/1.8/gems/rspec-2.0.0.beta.14 >> >>> $bundle show rspec-rails >>> ~/.bundle/ruby/1.8/gems/rspec-rails-2.0.0.beta.14.1 >> >>> Unfortunately, the bug still exists when using this configuration: >> >>> Before Each: >>> Featured Challenges size: 0 >>> Challenges count: 0 >>> .Before Each: >>> Featured Challenges size: 1 >>> Challenges count: 1 >>> .Before Each: >>> Featured Challenges size: 1 >>> Challenges count: 2 >>> FBefore Each: >>> Featured Challenges size: 2 >>> Challenges count: 3 >> >> What''s in your Gemfile and spec/spec_helper.rb? >> >> ps - please post in-line or at the bottom so we can follow the thread.> Hi David, > > -> http://gist.github.com/456941I forked and made a couple of changes: http://gist.github.com/457034 * Added :development to the group declaration on line 31 * Changed rspec-rails to beta.14.2 * Removed the rspec declaration (it''s a dependency of rspec-rails, so unnecessary) * Changed what is now line 44 to what gets generated now Not sure if this will fix anything, but let''s see.
Timo Rößner
2010-Jun-30 16:49 UTC
[rspec-users] rspec 2 not cleaning up after examples run?
On Jun 29, 12:14?pm, David Chelimsky <dchelim... at gmail.com> wrote:> On Jun 29, 2010, at 2:50 AM, Timo R??ner wrote: > > > > > On Jun 28, 5:35 pm, David Chelimsky <dchelim... at gmail.com> wrote: > >> On Jun 28, 2010, at 10:30 AM, Timo R??ner wrote: > >>> On Jun 28, 5:03 pm, David Chelimsky <dchelim... at gmail.com> wrote: > >>>> On Jun 28, 2010, at 10:00 AM, Timo R??ner wrote: > > >>>>> Hey guys, > > >>>>> I let the code speak for itself: > > >>>>> Below are my currently failing specs, please don''t pay too much > >>>>> attention to the specs themselves, I just want to give you a "real > >>>>> life example" of what''s happening - the only interesting thing about > >>>>> the specs is that there is a call to Factory(:challenge) in each of > >>>>> them and a before-each-call putting out what''s currently in the > >>>>> database: > > >>>>> ?describe ''featuring'' do > > >>>>> ? ?before(:each) do > >>>>> ? ? ?puts "Before Each:" > >>>>> ? ? ?puts "Featured Challenges size: #{Challenge.featured.size}" > >>>>> ? ? ?puts "Challenges count: #{Challenge.count}" > >>>>> ? ?end > > >>>>> ? ?it ''should tell if a challenge is featured'' do > >>>>> ? ? ?challenge = Factory(:challenge, :feature_position => 1) > >>>>> ? ? ?challenge.should be_featured > >>>>> ? ?end > > >>>>> ? ?it ''should tell if a challenge is not featured'' do > >>>>> ? ? ?challenge = Factory(:challenge, :feature_position => 0) > >>>>> ? ? ?challenge.should_not be_featured > >>>>> ? ?end > > >>>>> ? ?it ''should feature a challenge'' do > >>>>> ? ? ?challenge = Factory(:challenge) > >>>>> ? ? ?challenge.feature! > >>>>> ? ? ?Challenge.featured.should == [challenge] > >>>>> ? ?end > > >>>>> ? ?it ''should unfeature a challenge'' do > >>>>> ? ? ?challenge = Factory(:challenge, :feature_position => 1) > >>>>> ? ? ?challenge.unfeature! > >>>>> ? ? ?Challenge.featured.should be_empty > >>>>> ? ?end > >>>>> ?end > > >>>>> Now to the interesting part: > > >>>>> A spec run using rails 2.3.5 and rspec 1: > > >>>>> bundle exec spec spec/models/challenge_spec.rb > >>>>> Before Each: > >>>>> Featured Challenges size: 0 > >>>>> Challenges count: 0 > >>>>> .Before Each: > >>>>> Featured Challenges size: 0 > >>>>> Challenges count: 0 > >>>>> .Before Each: > >>>>> Featured Challenges size: 0 > >>>>> Challenges count: 0 > >>>>> .Before Each: > >>>>> Featured Challenges size: 0 > >>>>> Challenges count: 0 > >>>>> .............................. > > >>>>> -> Looks good. > > >>>>> Here''s the exact same spec run with rspec-2.0.0.beta.13 and > >>>>> rails-3.0.0.beta4: > > >>>>> Before Each: > >>>>> Featured Challenges size: 0 > >>>>> Challenges count: 0 > >>>>> Before Each: > >>>>> Featured Challenges size: 1 > >>>>> Challenges count: 1 > >>>>> .Before Each: > >>>>> Featured Challenges size: 1 > >>>>> Challenges count: 2 > >>>>> Before Each: > >>>>> Featured Challenges size: 2 > >>>>> Challenges count: 3 > > >>>>> So apparently the latest rspec doesn''t clean up after examples at all? > > >>>>> Is this a bug or a feature? > > >>>> Bug, but please check if it''s still true of beta.14.1. > > >>> Hey David, > > >>> I just tried it out using the latest rspec and rspec-rails: > > >>> Gemfile: > > >>> ?gem ''rspec'', ''2.0.0.beta.14'' > >>> ?gem ''rspec-rails'', ''2.0.0.beta.14.1 > > >>> $ bundle show rspec > >>> ~/.bundle/ruby/1.8/gems/rspec-2.0.0.beta.14 > > >>> $bundle show rspec-rails > >>> ~/.bundle/ruby/1.8/gems/rspec-rails-2.0.0.beta.14.1 > > >>> Unfortunately, the bug still exists when using this configuration: > > >>> Before Each: > >>> Featured Challenges size: 0 > >>> Challenges count: 0 > >>> .Before Each: > >>> Featured Challenges size: 1 > >>> Challenges count: 1 > >>> .Before Each: > >>> Featured Challenges size: 1 > >>> Challenges count: 2 > >>> FBefore Each: > >>> Featured Challenges size: 2 > >>> Challenges count: 3 > > >> What''s in your Gemfile and spec/spec_helper.rb? > > >> ps - please post in-line or at the bottom so we can follow the thread. > > Hi David, > > > ->http://gist.github.com/456941 > > I forked and made a couple of changes:http://gist.github.com/457034 > > * Added :development to the group declaration on line 31 > * Changed rspec-rails to beta.14.2 > * Removed the rspec declaration (it''s a dependency of rspec-rails, so unnecessary) > * Changed what is now line 44 to what gets generated now > > Not sure if this will fix anything, but let''s see. > _______________________________________________ > rspec-users mailing list > rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-usersHey, @Wincent alright, thanks. @David I changed my Gemfile and my spec_helper as you suggested (right now they are exactly the same as in your gist) and ran "bundle install". Unfortunately this setup seems to cause another problem: ( $ ) bundle exec spec spec/models/challenge_spec.rb /usr/lib/ruby/gems/1.8/gems/bundler-0.9.26/lib/bundler/ shared_helpers.rb:153:in `bin_path'': can''t find executable spec (Gem::Exception) from ~/.bundle/ruby/1.8/bin/spec:19 ( $ ) bundle show rspec ~.bundle/ruby/1.8/gems/rspec-2.0.0.beta.15
Timo Rößner
2010-Jun-30 16:55 UTC
[rspec-users] rspec 2 not cleaning up after examples run?
On Jun 29, 12:14?pm, David Chelimsky <dchelim... at gmail.com> wrote:> On Jun 29, 2010, at 2:50 AM, Timo R??ner wrote: > > > > > On Jun 28, 5:35 pm, David Chelimsky <dchelim... at gmail.com> wrote: > >> On Jun 28, 2010, at 10:30 AM, Timo R??ner wrote: > >>> On Jun 28, 5:03 pm, David Chelimsky <dchelim... at gmail.com> wrote: > >>>> On Jun 28, 2010, at 10:00 AM, Timo R??ner wrote: > > >>>>> Hey guys, > > >>>>> I let the code speak for itself: > > >>>>> Below are my currently failing specs, please don''t pay too much > >>>>> attention to the specs themselves, I just want to give you a "real > >>>>> life example" of what''s happening - the only interesting thing about > >>>>> the specs is that there is a call to Factory(:challenge) in each of > >>>>> them and a before-each-call putting out what''s currently in the > >>>>> database: > > >>>>> ?describe ''featuring'' do > > >>>>> ? ?before(:each) do > >>>>> ? ? ?puts "Before Each:" > >>>>> ? ? ?puts "Featured Challenges size: #{Challenge.featured.size}" > >>>>> ? ? ?puts "Challenges count: #{Challenge.count}" > >>>>> ? ?end > > >>>>> ? ?it ''should tell if a challenge is featured'' do > >>>>> ? ? ?challenge = Factory(:challenge, :feature_position => 1) > >>>>> ? ? ?challenge.should be_featured > >>>>> ? ?end > > >>>>> ? ?it ''should tell if a challenge is not featured'' do > >>>>> ? ? ?challenge = Factory(:challenge, :feature_position => 0) > >>>>> ? ? ?challenge.should_not be_featured > >>>>> ? ?end > > >>>>> ? ?it ''should feature a challenge'' do > >>>>> ? ? ?challenge = Factory(:challenge) > >>>>> ? ? ?challenge.feature! > >>>>> ? ? ?Challenge.featured.should == [challenge] > >>>>> ? ?end > > >>>>> ? ?it ''should unfeature a challenge'' do > >>>>> ? ? ?challenge = Factory(:challenge, :feature_position => 1) > >>>>> ? ? ?challenge.unfeature! > >>>>> ? ? ?Challenge.featured.should be_empty > >>>>> ? ?end > >>>>> ?end > > >>>>> Now to the interesting part: > > >>>>> A spec run using rails 2.3.5 and rspec 1: > > >>>>> bundle exec spec spec/models/challenge_spec.rb > >>>>> Before Each: > >>>>> Featured Challenges size: 0 > >>>>> Challenges count: 0 > >>>>> .Before Each: > >>>>> Featured Challenges size: 0 > >>>>> Challenges count: 0 > >>>>> .Before Each: > >>>>> Featured Challenges size: 0 > >>>>> Challenges count: 0 > >>>>> .Before Each: > >>>>> Featured Challenges size: 0 > >>>>> Challenges count: 0 > >>>>> .............................. > > >>>>> -> Looks good. > > >>>>> Here''s the exact same spec run with rspec-2.0.0.beta.13 and > >>>>> rails-3.0.0.beta4: > > >>>>> Before Each: > >>>>> Featured Challenges size: 0 > >>>>> Challenges count: 0 > >>>>> Before Each: > >>>>> Featured Challenges size: 1 > >>>>> Challenges count: 1 > >>>>> .Before Each: > >>>>> Featured Challenges size: 1 > >>>>> Challenges count: 2 > >>>>> Before Each: > >>>>> Featured Challenges size: 2 > >>>>> Challenges count: 3 > > >>>>> So apparently the latest rspec doesn''t clean up after examples at all? > > >>>>> Is this a bug or a feature? > > >>>> Bug, but please check if it''s still true of beta.14.1. > > >>> Hey David, > > >>> I just tried it out using the latest rspec and rspec-rails: > > >>> Gemfile: > > >>> ?gem ''rspec'', ''2.0.0.beta.14'' > >>> ?gem ''rspec-rails'', ''2.0.0.beta.14.1 > > >>> $ bundle show rspec > >>> ~/.bundle/ruby/1.8/gems/rspec-2.0.0.beta.14 > > >>> $bundle show rspec-rails > >>> ~/.bundle/ruby/1.8/gems/rspec-rails-2.0.0.beta.14.1 > > >>> Unfortunately, the bug still exists when using this configuration: > > >>> Before Each: > >>> Featured Challenges size: 0 > >>> Challenges count: 0 > >>> .Before Each: > >>> Featured Challenges size: 1 > >>> Challenges count: 1 > >>> .Before Each: > >>> Featured Challenges size: 1 > >>> Challenges count: 2 > >>> FBefore Each: > >>> Featured Challenges size: 2 > >>> Challenges count: 3 > > >> What''s in your Gemfile and spec/spec_helper.rb? > > >> ps - please post in-line or at the bottom so we can follow the thread. > > Hi David, > > > ->http://gist.github.com/456941 > > I forked and made a couple of changes:http://gist.github.com/457034 > > * Added :development to the group declaration on line 31 > * Changed rspec-rails to beta.14.2 > * Removed the rspec declaration (it''s a dependency of rspec-rails, so unnecessary) > * Changed what is now line 44 to what gets generated now > > Not sure if this will fix anything, but let''s see. > _______________________________________________ > rspec-users mailing list > rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-usersHey, @Wincent alright, thanks. @David I changed my Gemfile and my spec_helper as you suggested (right now they are exactly the same as in your gist) and ran "bundle install". Unfortunately this setup seems to cause another problem: ( $ ) bundle exec spec spec/models/challenge_spec.rb /usr/lib/ruby/gems/1.8/gems/bundler-0.9.26/lib/bundler/ shared_helpers.rb:153:in `bin_path'': can''t find executable spec (Gem::Exception) from ~/.bundle/ruby/1.8/bin/spec:19 ( $ ) bundle show rspec ~.bundle/ruby/1.8/gems/rspec-2.0.0.beta.15
David Chelimsky
2010-Jun-30 17:26 UTC
[rspec-users] rspec 2 not cleaning up after examples run?
On Jun 30, 2010, at 11:55 AM, Timo R??ner wrote:> On Jun 29, 12:14 pm, David Chelimsky <dchelim... at gmail.com> wrote: >> On Jun 29, 2010, at 2:50 AM, Timo R??ner wrote: >> >> >> >>> On Jun 28, 5:35 pm, David Chelimsky <dchelim... at gmail.com> wrote: >>>> On Jun 28, 2010, at 10:30 AM, Timo R??ner wrote: >>>>> On Jun 28, 5:03 pm, David Chelimsky <dchelim... at gmail.com> wrote: >>>>>> On Jun 28, 2010, at 10:00 AM, Timo R??ner wrote: >> >>>>>>> Hey guys, >> >>>>>>> I let the code speak for itself: >> >>>>>>> Below are my currently failing specs, please don''t pay too much >>>>>>> attention to the specs themselves, I just want to give you a "real >>>>>>> life example" of what''s happening - the only interesting thing about >>>>>>> the specs is that there is a call to Factory(:challenge) in each of >>>>>>> them and a before-each-call putting out what''s currently in the >>>>>>> database: >> >>>>>>> describe ''featuring'' do >> >>>>>>> before(:each) do >>>>>>> puts "Before Each:" >>>>>>> puts "Featured Challenges size: #{Challenge.featured.size}" >>>>>>> puts "Challenges count: #{Challenge.count}" >>>>>>> end >> >>>>>>> it ''should tell if a challenge is featured'' do >>>>>>> challenge = Factory(:challenge, :feature_position => 1) >>>>>>> challenge.should be_featured >>>>>>> end >> >>>>>>> it ''should tell if a challenge is not featured'' do >>>>>>> challenge = Factory(:challenge, :feature_position => 0) >>>>>>> challenge.should_not be_featured >>>>>>> end >> >>>>>>> it ''should feature a challenge'' do >>>>>>> challenge = Factory(:challenge) >>>>>>> challenge.feature! >>>>>>> Challenge.featured.should == [challenge] >>>>>>> end >> >>>>>>> it ''should unfeature a challenge'' do >>>>>>> challenge = Factory(:challenge, :feature_position => 1) >>>>>>> challenge.unfeature! >>>>>>> Challenge.featured.should be_empty >>>>>>> end >>>>>>> end >> >>>>>>> Now to the interesting part: >> >>>>>>> A spec run using rails 2.3.5 and rspec 1: >> >>>>>>> bundle exec spec spec/models/challenge_spec.rb >>>>>>> Before Each: >>>>>>> Featured Challenges size: 0 >>>>>>> Challenges count: 0 >>>>>>> .Before Each: >>>>>>> Featured Challenges size: 0 >>>>>>> Challenges count: 0 >>>>>>> .Before Each: >>>>>>> Featured Challenges size: 0 >>>>>>> Challenges count: 0 >>>>>>> .Before Each: >>>>>>> Featured Challenges size: 0 >>>>>>> Challenges count: 0 >>>>>>> .............................. >> >>>>>>> -> Looks good. >> >>>>>>> Here''s the exact same spec run with rspec-2.0.0.beta.13 and >>>>>>> rails-3.0.0.beta4: >> >>>>>>> Before Each: >>>>>>> Featured Challenges size: 0 >>>>>>> Challenges count: 0 >>>>>>> Before Each: >>>>>>> Featured Challenges size: 1 >>>>>>> Challenges count: 1 >>>>>>> .Before Each: >>>>>>> Featured Challenges size: 1 >>>>>>> Challenges count: 2 >>>>>>> Before Each: >>>>>>> Featured Challenges size: 2 >>>>>>> Challenges count: 3 >> >>>>>>> So apparently the latest rspec doesn''t clean up after examples at all? >> >>>>>>> Is this a bug or a feature? >> >>>>>> Bug, but please check if it''s still true of beta.14.1. >> >>>>> Hey David, >> >>>>> I just tried it out using the latest rspec and rspec-rails: >> >>>>> Gemfile: >> >>>>> gem ''rspec'', ''2.0.0.beta.14'' >>>>> gem ''rspec-rails'', ''2.0.0.beta.14.1 >> >>>>> $ bundle show rspec >>>>> ~/.bundle/ruby/1.8/gems/rspec-2.0.0.beta.14 >> >>>>> $bundle show rspec-rails >>>>> ~/.bundle/ruby/1.8/gems/rspec-rails-2.0.0.beta.14.1 >> >>>>> Unfortunately, the bug still exists when using this configuration: >> >>>>> Before Each: >>>>> Featured Challenges size: 0 >>>>> Challenges count: 0 >>>>> .Before Each: >>>>> Featured Challenges size: 1 >>>>> Challenges count: 1 >>>>> .Before Each: >>>>> Featured Challenges size: 1 >>>>> Challenges count: 2 >>>>> FBefore Each: >>>>> Featured Challenges size: 2 >>>>> Challenges count: 3 >> >>>> What''s in your Gemfile and spec/spec_helper.rb? >> >>>> ps - please post in-line or at the bottom so we can follow the thread. >>> Hi David, >> >>> ->http://gist.github.com/456941 >> >> I forked and made a couple of changes:http://gist.github.com/457034 >> >> * Added :development to the group declaration on line 31 >> * Changed rspec-rails to beta.14.2 >> * Removed the rspec declaration (it''s a dependency of rspec-rails, so unnecessary) >> * Changed what is now line 44 to what gets generated now >> >> Not sure if this will fix anything, but let''s see. >> _______________________________________________ >> rspec-users mailing list >> rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users > > Hey, > > @Wincent alright, thanks. > > @David > > I changed my Gemfile and my spec_helper as you suggested (right now > they are exactly the same as in your gist) and ran "bundle install". > > Unfortunately this setup seems to cause another problem: > > ( $ ) bundle exec spec spec/models/challenge_spec.rb > /usr/lib/ruby/gems/1.8/gems/bundler-0.9.26/lib/bundler/ > shared_helpers.rb:153:in `bin_path'': can''t find executable spec > (Gem::Exception) > from ~/.bundle/ruby/1.8/bin/spec:19 > > ( $ ) bundle show rspec > ~.bundle/ruby/1.8/gems/rspec-2.0.0.beta.15The command is rspec in rspec 2. Try: bundle exec rspec spec/models/challenge_spec.rb Cheers, David
Amiruddin Nagri
2010-Jun-30 17:44 UTC
[rspec-users] rspec 2 not cleaning up after examples run?
I am not sure if this will help or not but I was also getting data not cleared properly when run specs through rake but when ran using script/spec it was cleaning up the data Amir On Jun 30, 2010 10:56 PM, "David Chelimsky" <dchelimsky at gmail.com> wrote: On Jun 30, 2010, at 11:55 AM, Timo R??ner wrote:> On Jun 29, 12:14 pm, David Chelimsky <dchelim.....The command is rspec in rspec 2. Try: bundle exec rspec spec/models/challenge_spec.rb Cheers, David _______________________________________________ rspec-users mailing list rspec-users at rubyforge.org h... -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20100630/7f139cf2/attachment.html>
Timo Rößner
2010-Jul-01 08:22 UTC
[rspec-users] rspec 2 not cleaning up after examples run?
@David, alright, I tried: bundle exec rspec spec/models/challenge_spec.rb -> Same results, same log output as above. @Amiruddin script/spec would be rails 2 / rspec 1 - my problem occurs with rails 3 / rspec 2 (and script/spec doesn''t exist because of that). On Jun 30, 7:44?pm, Amiruddin Nagri <amir.na... at gmail.com> wrote:> I am not sure if this will help or not but I was also getting data not > cleared properly when run specs through rake but when ran using script/spec > it was cleaning up the data > > Amir > > On Jun 30, 2010 10:56 PM, "David Chelimsky" <dchelim... at gmail.com> wrote: > > On Jun 30, 2010, at 11:55 AM, Timo R??ner wrote: > > > On Jun 29, 12:14 pm, David Chelimsky <dchelim..... > > The command is rspec in rspec 2. Try: > > bundle exec rspec spec/models/challenge_spec.rb > > Cheers, > David > > _______________________________________________ > rspec-users mailing list > rspec-us... at rubyforge.org > h... > > _______________________________________________ > rspec-users mailing list > rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users
David Chelimsky
2010-Jul-01 12:15 UTC
[rspec-users] rspec 2 not cleaning up after examples run?
On Jul 1, 2010, at 3:22 AM, Timo R??ner wrote:> On Jun 30, 7:44 pm, Amiruddin Nagri <amir.na... at gmail.com> wrote: >> I am not sure if this will help or not but I was also getting data not >> cleared properly when run specs through rake but when ran using script/spec >> it was cleaning up the data >> >> Amir >> >> On Jun 30, 2010 10:56 PM, "David Chelimsky" <dchelim... at gmail.com> wrote: >> >> On Jun 30, 2010, at 11:55 AM, Timo R??ner wrote: >> >>> On Jun 29, 12:14 pm, David Chelimsky <dchelim..... >> >> The command is rspec in rspec 2. Try: >> >> bundle exec rspec spec/models/challenge_spec.rb > @David, > > alright, I tried: > > bundle exec rspec spec/models/challenge_spec.rb > > -> Same results, same log output as above. > > @Amiruddin > > script/spec would be rails 2 / rspec 1 - my problem occurs with rails > 3 / rspec 2 (and script/spec doesn''t exist because of that).Hard to break the top posting habit :) I moved your comments to the bottom. @Timo - I''m sorry I missed this the first time through, but it''s because the spec_helper config is missing this line: config.use_transactional_fixtures = true The post-install hook when you install rspec-rails instructs you to re-run ''script/rails generate rspec:install'', and if you do so you''ll see this line in the generated spec_helper. Let me know if that solves it. I''m pretty sure it will. Cheers, David
Timo Rößner
2010-Jul-05 22:16 UTC
[rspec-users] rspec 2 not cleaning up after examples run?
Hey David, sorry for the late reply, you nailed it, that was the problem indeed..:-) Thanks a lot for the assist. Cheers On Jul 1, 2:15?pm, David Chelimsky <dchelim... at gmail.com> wrote:> On Jul 1, 2010, at 3:22 AM, Timo R??ner wrote: > > > > > On Jun 30, 7:44 pm, Amiruddin Nagri <amir.na... at gmail.com> wrote: > >> I am not sure if this will help or not but I was also getting data not > >> cleared properly when run specs through rake but when ran using script/spec > >> it was cleaning up the data > > >> Amir > > >> On Jun 30, 2010 10:56 PM, "David Chelimsky" <dchelim... at gmail.com> wrote: > > >> On Jun 30, 2010, at 11:55 AM, Timo R??ner wrote: > > >>> On Jun 29, 12:14 pm, David Chelimsky <dchelim..... > > >> The command is rspec in rspec 2. Try: > > >> bundle exec rspec spec/models/challenge_spec.rb > > @David, > > > alright, I tried: > > > ?bundle exec rspec spec/models/challenge_spec.rb > > > -> Same results, same log output as above. > > > @Amiruddin > > > script/spec would be rails 2 / rspec 1 - my problem occurs with rails > > 3 / rspec 2 (and script/spec doesn''t exist because of that). > > Hard to break the top posting habit :) I moved your comments to the bottom. > > @Timo - I''m sorry I missed this the first time through, but it''s because the spec_helper config is missing this line: > > ? config.use_transactional_fixtures = true > > The post-install hook when you install rspec-rails instructs you to re-run ''script/rails generate rspec:install'', and if you do so you''ll see this line in the generated spec_helper. > > Let me know if that solves it. I''m pretty sure it will. > > Cheers, > David > _______________________________________________ > rspec-users mailing list > rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users