Nori Hamamoto
2011-Jan-14 06:19 UTC
[rspec-users] found some inconsistently behavior on its method.
Hi there, I''ve just started using rspec and rspec-rails (both are the newest version on git repository). I met some inconsistently behavior on it method and its method. The following is the way to reproduce it: command line:> script/generate spec_controller product showModify a file spec/products_controller_spec.rb like the following: require ''spec_helper'' describe ProductsController do describe Array do subject { Array.new } it { should be_empty } its(:size) { should == 0 } end end Then, when I run spec, the first example (it { should be_empty }) pass the test, but not the second one(its(:size){ should == 0 }). How so? I''ve found a similar issue: describe 10 do it { should == 10 } its(:to_s) { should == "10" } end The first one passes, but not for the second one. Is this a bug on rspec 1.3.1? Another example: describe Array do its(:empty?) { should be_true } # pass end describe [] do its(:empty?) { should be_true } # not pass end The first one passes the test where as the second one doesn''t pass. So, what''s going on on its method?? Thank you, norisuke3 at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20110114/9b5cc3b1/attachment.html>
David Chelimsky
2011-Jan-14 12:44 UTC
[rspec-users] found some inconsistently behavior on its method.
On Jan 14, 2011, at 12:19 AM, Nori Hamamoto wrote:> Hi there, > > I''ve just started using rspec and rspec-rails (both are the newest version on git repository). > I met some inconsistently behavior on it method and its method. > The following is the way to reproduce it: > > command line: > > > script/generate spec_controller product show > > Modify a file spec/products_controller_spec.rb like the following: > > require ''spec_helper'' > > describe ProductsController do > describe Array do > subject { Array.new } > it { should be_empty } > its(:size) { should == 0 } > end > end > > Then, when I run spec, the first example (it { should be_empty }) pass the test, but not the second one(its(:size){ should == 0 }). > How so? > > I''ve found a similar issue: > > describe 10 do > it { should == 10 } > its(:to_s) { should == "10" } > end > > The first one passes, but not for the second one. > Is this a bug on rspec 1.3.1? > > Another example: > > describe Array do > its(:empty?) { should be_true } # pass > end > > describe [] do > its(:empty?) { should be_true } # not pass > end > > The first one passes the test where as the second one doesn''t pass. > So, what''s going on on its method??All of these pass in rspec-2, but it looks like there are some inconsistencies in rspec-1. You''re welcome to file bug reports for this, but I can tell you that unless somebody else submits patches for it it''s unlikely to get fixed. Bug reports for rspec-1 live at http://rspec.lighthouseapp.com. Cheers, David -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20110114/a7dc6dcd/attachment.html>
Nori Hamamoto
2011-Jan-14 13:29 UTC
[rspec-users] found some inconsistently behavior on its method.
I said I''m using the newest version on the repository, but I mean that the newest version of rspec1''s repository. I didn''t try it on rspec2 because according to rspec2''s git repository, it doesn''t support rails 2 and I''m using rails 2. Sorry about the lack of the information in my report. Cheers, Nori On Fri, Jan 14, 2011 at 8:44 AM, David Chelimsky <dchelimsky at gmail.com>wrote:> On Jan 14, 2011, at 12:19 AM, Nori Hamamoto wrote: > > Hi there, > > I''ve just started using rspec and rspec-rails (both are the newest version > on git repository). > I met some inconsistently behavior on it method and its method. > The following is the way to reproduce it: > > command line: > > > script/generate spec_controller product show > > Modify a file spec/products_controller_spec.rb like the following: > > require ''spec_helper'' > > describe ProductsController do > describe Array do > subject { Array.new } > it { should be_empty } > its(:size) { should == 0 } > end > end > > Then, when I run spec, the first example (it { should be_empty }) pass the > test, but not the second one(its(:size){ should == 0 }). > How so? > > I''ve found a similar issue: > > describe 10 do > it { should == 10 } > its(:to_s) { should == "10" } > end > > The first one passes, but not for the second one. > Is this a bug on rspec 1.3.1? > > Another example: > > describe Array do > its(:empty?) { should be_true } # pass > end > > describe [] do > its(:empty?) { should be_true } # not pass > end > > The first one passes the test where as the second one doesn''t pass. > So, what''s going on on its method?? > > > All of these pass in rspec-2, but it looks like there are some > inconsistencies in rspec-1. You''re welcome to file bug reports for this, but > I can tell you that unless somebody else submits patches for it it''s > unlikely to get fixed. > > Bug reports for rspec-1 live at http://rspec.lighthouseapp.com. > > Cheers, > David > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20110114/cc8e23c8/attachment-0001.html>
David Chelimsky
2011-Jan-14 14:57 UTC
[rspec-users] found some inconsistently behavior on its method.
On Jan 14, 2011, at 7:29 AM, Nori Hamamoto <norisuke3 at gmail.com> wrote:> I said I''m using the newest version on the repository, but I mean that the newest version of rspec1''s repository. > I didn''t try it on rspec2 because according to rspec2''s git repository, it doesn''t support rails 2 and I''m using rails 2. > Sorry about the lack of the information in my report.No apology necessary. There are a couple of projects in the works to make rspec 2 work with rails 2, but I don''t think any are ready for general consumption.> Cheers, > Nori > > On Fri, Jan 14, 2011 at 8:44 AM, David Chelimsky <dchelimsky at gmail.com> wrote: > On Jan 14, 2011, at 12:19 AM, Nori Hamamoto wrote: > >> Hi there, >> >> I''ve just started using rspec and rspec-rails (both are the newest version on git repository). >> I met some inconsistently behavior on it method and its method. >> The following is the way to reproduce it: >> >> command line: >> >> > script/generate spec_controller product show >> >> Modify a file spec/products_controller_spec.rb like the following: >> >> require ''spec_helper'' >> >> describe ProductsController do >> describe Array do >> subject { Array.new } >> it { should be_empty } >> its(:size) { should == 0 } >> end >> end >> >> Then, when I run spec, the first example (it { should be_empty }) pass the test, but not the second one(its(:size){ should == 0 }). >> How so? >> >> I''ve found a similar issue: >> >> describe 10 do >> it { should == 10 } >> its(:to_s) { should == "10" } >> end >> >> The first one passes, but not for the second one. >> Is this a bug on rspec 1.3.1? >> >> Another example: >> >> describe Array do >> its(:empty?) { should be_true } # pass >> end >> >> describe [] do >> its(:empty?) { should be_true } # not pass >> end >> >> The first one passes the test where as the second one doesn''t pass. >> So, what''s going on on its method?? > > All of these pass in rspec-2, but it looks like there are some inconsistencies in rspec-1. You''re welcome to file bug reports for this, but I can tell you that unless somebody else submits patches for it it''s unlikely to get fixed. > > Bug reports for rspec-1 live at http://rspec.lighthouseapp.com. > > 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-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20110114/b08f67e4/attachment.html>
Nori Hamamoto
2011-Jan-14 16:18 UTC
[rspec-users] found some inconsistently behavior on its method.
Sounds good!! Nori On Fri, Jan 14, 2011 at 10:57 AM, David Chelimsky <dchelimsky at gmail.com>wrote:> On Jan 14, 2011, at 7:29 AM, Nori Hamamoto <norisuke3 at gmail.com> wrote: > > I said I''m using the newest version on the repository, but I mean that the > newest version of rspec1''s repository. > I didn''t try it on rspec2 because according to rspec2''s git repository, it > doesn''t support rails 2 and I''m using rails 2. > Sorry about the lack of the information in my report. > > > No apology necessary. There are a couple of projects in the works to make > rspec 2 work with rails 2, but I don''t think any are ready for general > consumption. > > Cheers, > Nori > > On Fri, Jan 14, 2011 at 8:44 AM, David Chelimsky < <dchelimsky at gmail.com> > dchelimsky at gmail.com> wrote: > >> On Jan 14, 2011, at 12:19 AM, Nori Hamamoto wrote: >> >> Hi there, >> >> I''ve just started using rspec and rspec-rails (both are the newest version >> on git repository). >> I met some inconsistently behavior on it method and its method. >> The following is the way to reproduce it: >> >> command line: >> >> > script/generate spec_controller product show >> >> Modify a file spec/products_controller_spec.rb like the following: >> >> require ''spec_helper'' >> >> describe ProductsController do >> describe Array do >> subject { Array.new } >> it { should be_empty } >> its(:size) { should == 0 } >> end >> end >> >> Then, when I run spec, the first example (it { should be_empty }) pass the >> test, but not the second one(its(:size){ should == 0 }). >> How so? >> >> I''ve found a similar issue: >> >> describe 10 do >> it { should == 10 } >> its(:to_s) { should == "10" } >> end >> >> The first one passes, but not for the second one. >> Is this a bug on rspec 1.3.1? >> >> Another example: >> >> describe Array do >> its(:empty?) { should be_true } # pass >> end >> >> describe [] do >> its(:empty?) { should be_true } # not pass >> end >> >> The first one passes the test where as the second one doesn''t pass. >> So, what''s going on on its method?? >> >> >> All of these pass in rspec-2, but it looks like there are some >> inconsistencies in rspec-1. You''re welcome to file bug reports for this, but >> I can tell you that unless somebody else submits patches for it it''s >> unlikely to get fixed. >> >> Bug reports for rspec-1 live at <http://rspec.lighthouseapp.com> >> http://rspec.lighthouseapp.com. >> >> Cheers, >> David >> >> _______________________________________________ >> rspec-users mailing list >> <rspec-users at rubyforge.org>rspec-users at rubyforge.org >> <http://rubyforge.org/mailman/listinfo/rspec-users> >> 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 >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20110114/8000d7ad/attachment.html>
Nori Hamamoto
2011-Jan-14 20:39 UTC
[rspec-users] found some inconsistently behavior on its method.
Hi David, I''ve sent a patch for this problem via github. Please check it out. Thank you, Nori On Fri, Jan 14, 2011 at 12:18 PM, Nori Hamamoto <norisuke3 at gmail.com> wrote:> Sounds good!! > > Nori > > On Fri, Jan 14, 2011 at 10:57 AM, David Chelimsky <dchelimsky at gmail.com>wrote: > >> On Jan 14, 2011, at 7:29 AM, Nori Hamamoto <norisuke3 at gmail.com> wrote: >> >> I said I''m using the newest version on the repository, but I mean that the >> newest version of rspec1''s repository. >> I didn''t try it on rspec2 because according to rspec2''s git repository, it >> doesn''t support rails 2 and I''m using rails 2. >> Sorry about the lack of the information in my report. >> >> >> No apology necessary. There are a couple of projects in the works to make >> rspec 2 work with rails 2, but I don''t think any are ready for general >> consumption. >> >> Cheers, >> Nori >> >> On Fri, Jan 14, 2011 at 8:44 AM, David Chelimsky < <dchelimsky at gmail.com> >> dchelimsky at gmail.com> wrote: >> >>> On Jan 14, 2011, at 12:19 AM, Nori Hamamoto wrote: >>> >>> Hi there, >>> >>> I''ve just started using rspec and rspec-rails (both are the newest >>> version on git repository). >>> I met some inconsistently behavior on it method and its method. >>> The following is the way to reproduce it: >>> >>> command line: >>> >>> > script/generate spec_controller product show >>> >>> Modify a file spec/products_controller_spec.rb like the following: >>> >>> require ''spec_helper'' >>> >>> describe ProductsController do >>> describe Array do >>> subject { Array.new } >>> it { should be_empty } >>> its(:size) { should == 0 } >>> end >>> end >>> >>> Then, when I run spec, the first example (it { should be_empty }) pass >>> the test, but not the second one(its(:size){ should == 0 }). >>> How so? >>> >>> I''ve found a similar issue: >>> >>> describe 10 do >>> it { should == 10 } >>> its(:to_s) { should == "10" } >>> end >>> >>> The first one passes, but not for the second one. >>> Is this a bug on rspec 1.3.1? >>> >>> Another example: >>> >>> describe Array do >>> its(:empty?) { should be_true } # pass >>> end >>> >>> describe [] do >>> its(:empty?) { should be_true } # not pass >>> end >>> >>> The first one passes the test where as the second one doesn''t pass. >>> So, what''s going on on its method?? >>> >>> >>> All of these pass in rspec-2, but it looks like there are some >>> inconsistencies in rspec-1. You''re welcome to file bug reports for this, but >>> I can tell you that unless somebody else submits patches for it it''s >>> unlikely to get fixed. >>> >>> Bug reports for rspec-1 live at <http://rspec.lighthouseapp.com> >>> http://rspec.lighthouseapp.com. >>> >>> Cheers, >>> David >>> >>> _______________________________________________ >>> rspec-users mailing list >>> <rspec-users at rubyforge.org>rspec-users at rubyforge.org >>> <http://rubyforge.org/mailman/listinfo/rspec-users> >>> 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 >> > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20110114/a85d94e3/attachment.html>