I wrote following code and it did not work. describe User do it { should validate_presence_of(:email) } pending "should raise an error when email is blank and record is saved with false option" end Then I put pending inside it like one given below and it worked. describe User do it { should validate_presence_of(:email) } it "" do pending "should raise an error when email is blank and record is saved with false option" end end I know that rspec is well thought out . Then why rspec is forcing me to put empty it around pending line. Why can''t I just say that something is pending and I will get to it later. Thanks for all the good work.
On May 26, 2010, at 2:07 PM, Nadal wrote:> I wrote following code and it did not work. > > > describe User do > it { should validate_presence_of(:email) } > pending "should raise an error when email is blank and record is > saved with false option" > end > > > Then I put pending inside it like one given below and it worked. > > > describe User do > it { should validate_presence_of(:email) } > it "" do > pending "should raise an error when email is blank and record is > saved with false option" > end > end >Use an it with no block: it "should raise an error when email is blank and record is saved with false option" Scott> > > I know that rspec is well thought out . Then why rspec is forcing me > to put empty it around pending line. Why can''t I just say that > something is pending and I will get to it later. > > Thanks for all the good work. > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users
You can use an empty block instead: ===begin Ruby describe Apple do it "should be delicious" do # real test end it "should be crunchy" # still pending end ===end Ruby Then you''ll get: ===begin shell Apple - should be delicious - should be crunchy (PENDING: Not Yet Implemented) ===end shell Hope that helps. -- John Feminella Principal Consultant, Distilled Brilliance On Wed, May 26, 2010 at 14:07, Nadal <node.js99 at gmail.com> wrote:> I wrote following code and it did not work. > > > describe User do > ?it { should validate_presence_of(:email) } > ?pending "should raise an error when email is blank and record is > saved with false option" > end > > > Then I put pending inside it like one given below and it worked. > > > describe User do > ?it { should validate_presence_of(:email) } > ?it "" do > ?pending "should raise an error when email is blank and record is > saved with false option" > ?end > end > > > > I know that rspec is well thought out . Then why rspec is forcing me > to put empty it around pending line. Why can''t I just say that > something is pending and I will get to it later. > > Thanks for all the good work. > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
Thanks. That got me moving. I like how in rspec I can say context when I mean context and describe when I mean describe. Going by that principal here I should have been allowed to say pending when I mean pending and I should not be forced to use it which would come in report as pending. It is nitpicking but paying attention to such detail has made rspec so great. Just a fresh perspective since I am trying out rspec for the first time. On May 26, 2:20?pm, Scott Taylor <sc... at railsnewbie.com> wrote:> On May 26, 2010, at 2:07 PM, Nadal wrote: > > > > > > > I wrote following code and it did not work. > > > describe User do > > it { should validate_presence_of(:email) } > > pending "should raise an error when email is blank and record is > > saved with false option" > > end > > > Then I put pending inside it like one given below and it worked. > > > describe User do > > it { should validate_presence_of(:email) } > > it "" do > > ?pending "should raise an error when email is blank and record is > > saved with false option" > > end > > end > > Use an it with no block: > > it "should raise an error when email is blank and record is saved with false option" > > Scott > > > > > I know that rspec is well thought out . Then why rspec is forcing me > > to put empty it around pending line. Why can''t I just say that > > something is pending and I will get to it later. > > > Thanks for all the good work. > > _______________________________________________ > > rspec-users mailing list > > rspec-us... at rubyforge.org > >http://rubyforge.org/mailman/listinfo/rspec-users > > _______________________________________________ > rspec-users mailing list > rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users
On May 26, 2010, at 3:04 PM, Nadal wrote:> Thanks. That got me moving. > > I like how in rspec I can say context when I mean context and describe > when I mean describe. Going by that principal here I should have been > allowed to say pending when I mean pending and I should not be forced > to use it which would come in report as pending. > > It is nitpicking but paying attention to such detail has made rspec so > great. Just a fresh perspective since I am trying out rspec for the > first time.In rspec-2 you _can_ say pending like this: describe ''something'' do context ''in some context'' do pending ''it does something or other''> > On May 26, 2:20 pm, Scott Taylor <sc... at railsnewbie.com> wrote: >> On May 26, 2010, at 2:07 PM, Nadal wrote: >> >> >> >> >> >>> I wrote following code and it did not work. >> >>> describe User do >>> it { should validate_presence_of(:email) } >>> pending "should raise an error when email is blank and record is >>> saved with false option" >>> end >> >>> Then I put pending inside it like one given below and it worked. >> >>> describe User do >>> it { should validate_presence_of(:email) } >>> it "" do >>> pending "should raise an error when email is blank and record is >>> saved with false option" >>> end >>> end >> >> Use an it with no block: >> >> it "should raise an error when email is blank and record is saved with false option" >> >> Scott >> >> >> >>> I know that rspec is well thought out . Then why rspec is forcing me >>> to put empty it around pending line. Why can''t I just say that >>> something is pending and I will get to it later. >> >>> Thanks for all the good work. >>> _______________________________________________ >>> rspec-users mailing list >>> rspec-us... at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/rspec-users >> >> _______________________________________________ >> rspec-users mailing list >> rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users
awesome. That''s much better. On May 26, 4:28?pm, David Chelimsky <dchelim... at gmail.com> wrote:> On May 26, 2010, at 3:04 PM, Nadal wrote: > > > Thanks. That got me moving. > > > I like how in rspec I can say context when I mean context and describe > > when I mean describe. Going by that principal here I should have been > > allowed to say pending when I mean pending and I should not be forced > > to use it which would come in report as pending. > > > It is nitpicking but paying attention to such detail has made rspec so > > great. Just a fresh perspective since I am trying out rspec for the > > first time. > > In rspec-2 you _can_ say pending like this: > > describe ''something'' do > ? context ''in some context'' do > ? ? pending ''it does something or other'' > > > > > > > > > On May 26, 2:20 pm, Scott Taylor <sc... at railsnewbie.com> wrote: > >> On May 26, 2010, at 2:07 PM, Nadal wrote: > > >>> I wrote following code and it did not work. > > >>> describe User do > >>> it { should validate_presence_of(:email) } > >>> pending "should raise an error when email is blank and record is > >>> saved with false option" > >>> end > > >>> Then I put pending inside it like one given below and it worked. > > >>> describe User do > >>> it { should validate_presence_of(:email) } > >>> it "" do > >>> ?pending "should raise an error when email is blank and record is > >>> saved with false option" > >>> end > >>> end > > >> Use an it with no block: > > >> it "should raise an error when email is blank and record is saved with false option" > > >> Scott > > >>> I know that rspec is well thought out . Then why rspec is forcing me > >>> to put empty it around pending line. Why can''t I just say that > >>> something is pending and I will get to it later. > > >>> Thanks for all the good work. > >>> _______________________________________________ > >>> rspec-users mailing list > >>> rspec-us... at rubyforge.org > >>>http://rubyforge.org/mailman/listinfo/rspec-users > > >> _______________________________________________ > >> rspec-users mailing list > >> rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users > > _______________________________________________ > > rspec-users mailing list > > rspec-us... at rubyforge.org > >http://rubyforge.org/mailman/listinfo/rspec-users > > _______________________________________________ > rspec-users mailing list > rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users