ruby on rails - Keeping rspec convention with --format doc -
betterspecs suggests using like:
subject { assigns('message') } { should match /it born in billville/ } as practice. in case want run rspec in doc format (rspec -f doc) i'm receiving:
when call matcher in example without string, this: specify { object.should matcher } or this: { should matcher } rspec expects matcher have #description method. should either add string example matcher being used in, or give description method. won't have suffer lengthy warning again. so this
it "some desc" should match /it born in billville/ end won't raise annoying message seems ugly.
any ideas on how keep rspec conventions , code clean, , still have pretty output(like -f doc)?
rspec v.2.13.0
as rspec maintainer, there many things listed on betterspecs.org disagree. i've commented such on github issues project many months ago, sadly, don't think of concerns have been addressed :(.
anyhow, think one-liner syntax fine use when doc output matches want, not. usually, doc output of one-liner syntax overly specific, e.g. returns in doc strings should eq "dfgh" though not true behavior -- returns string without vowels removed better, more true description of behavior.
so suggestion not use one-liner syntax unless produces output want. don't use because betterspecs.org recommends it. many of recommendations bad recommendations, in opinion.
Comments
Post a Comment