Sorry if I mentioned this one before, but has anyone proposed being able to do something like "it should be able".to { } ? (or something like that)... Might be preferable where a test description doesn''t start with "it" Thoughts? Thanks. -r -- Posted via http://www.ruby-forum.com/.
On Dec 20, 2010, at 10:56 AM, Roger Pack wrote:> Sorry if I mentioned this one before, but has anyone proposed being able > to do something like > > > "it should be able".to { > > } > > ? (or something like that)... > > Might be preferable where a test description doesn''t start with "it"I think ending in "to" is just as constraining as starting with "it", no?> Thoughts?"it" and "specify" are both aliases for "example", so you can say: describe "foo" do example "doing something or other" do ... end end HTH, David>> Thanks. > -r > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users
On Mon, Dec 20, 2010 at 7:02 PM, David Chelimsky <dchelimsky at gmail.com> wrote: Probably one could argue that in a spec environment what I am about to say does not apply as much as in production code. Yet I feel that it is not the responsibility of a String to describe an example. This theoretical observation apart, I find the idea rather appealing. Anyway I am not qualified to vote or judge, just wanted to share these thoughts. Cheers Robert -- The 1,000,000th fibonacci number contains ''42'' 2039 times; that is almost 30 occurrences more than expected (208988 digits). N.B. The 42nd fibonacci number does not contain ''1000000'' that is almost the expected 3.0e-06 times.