I think you have a syntactical error on the line thats throwing the error, you state:> j.even?should be true #throws an error on j == 2, j == 4should this line not read as: j.even?.should be true -- Posted via http://www.ruby-forum.com/.
On 05/04/2012, at 8:02 AM, Brad Symons wrote:> I think you have a syntactical error on the line thats throwing the > error, you state: > >> j.even?should be true #throws an error on j == 2, j == 4 > > should this line not read as: > > j.even?.should be truelol j.even?.should be_true you mean?
-- Curtis J Schofield BlazingCloud.net "Creativity can solve anything" - George Lois (source: art & copy) On Apr 4, 2012, at 3:02 PM, Brad Symons <lists at ruby-forum.com> wrote:> I think you have a syntactical error on the line thats throwing the > error, you state: > >> j.even?should be true #throws an error on j == 2, j == 4 > > should this line not read as: > > j.even?.should be trueIt is this : non?> j.even?.should be_true> -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users
>>> j.even?should be true>> j.even?.should be true> j.even?.should be_trueNot to ignite a flame war, but this is my biggest problem with RSpec: Unless you''re an expert at Ruby syntax already, it''s really easy to make punctuation mistakes. And of course, it should be j.should be_even (though following Skitt''s Law, I probably got that wrong) - A P.S. In Wrong, it''s assert { j.even? } -- Alex Chaffee - alex at stinky.com http://alexchaffee.com http://twitter.com/alexch -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20120411/ab525354/attachment.html>
On Wed, Apr 11, 2012 at 12:47 PM, Alex Chaffee <alex at stinky.com> wrote:>>>> j.even?should be true > >>> j.even?.should be true > >> j.even?.should be_true > > Not to ignite a flame war, but this is my biggest problem with RSpec: Unless > you''re an expert at Ruby syntax already, it''s really easy to make > punctuation mistakes.If you make syntax errors then you won''t get to far with <insert-language-here>. While it is possible to make syntax errors with RSpec it''s also possible to make them outside of RSpec. Your experience may be different than mine, but I don''t recall making more typos in RSpec because of its syntax as opposed to making typos in a variety of languages (irregardless of if its a testing framework). But it''s entirely possible that my memory is rewriting history.> > And of course, it should be > > j.should be_even > > (though following Skitt''s Law, I probably got that wrong) > > ?- A > > P.S. In Wrong, it''s > > assert { j.even? }Yep, that''s another way of doing it. It''s not this little guy that keeps me from test/unit, it''s its cousins. Zach> > -- > Alex Chaffee - alex at stinky.com > http://alexchaffee.com > http://twitter.com/alexch > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users-- -- @zachdennis http://www.continuousthinking.com http://www.mutuallyhuman.com
Quoting Zach Dennis <zach.dennis at gmail.com>:> On Wed, Apr 11, 2012 at 12:47 PM, Alex Chaffee <alex at stinky.com> wrote: > >>>> j.even?should be true > > > >>> j.even?.should be true > > > >> j.even?.should be_true > > > > Not to ignite a flame war, but this is my biggest problem with RSpec: Unless > > you''re an expert at Ruby syntax already, it''s really easy to make > > punctuation mistakes. > > If you make syntax errors then you won''t get to far with > <insert-language-here>. While it is possible to make syntax errors > with RSpec it''s also possible to make them outside of RSpec.True. But I have found the english-like syntax of RSpec harder to remember than the ugly Test::Unit syntax. It is the superiority of RSpec''s test organization - and its ubiquity - that made me persist. -- Cynthia N. Kiser cnk at ugcs.caltech.edu