Hi,
Just installed 0.9.4 (from 0.8 series) and ran the spec translator. It
messed up specs that had the should include() where the argument to
include is a string (using no parens for the arg)
IOW, given:
context "OldSchool" do
class OldSchool
attr_accessor collection
def initialize
@collection = []
end
def add_new(item)
@collection << item
end
end
specify "should include string with ''?''" do
school = OldSchool.new
school.add_item ''like ?''
school.collection.should_include ''like ?''
end
end
The resulting translation is:
it "should include string with ''?''" do
school = OldSchool.new
school.add_item ''like ?''
school.collection.should include(''like)?''
end
It works ok if the original line is parenthesized
school.collection.should_include(''like ?'')
Ed
--
Ed Howland
http://greenprogrammer.blogspot.com
On 5/10/07, Ed Howland <ed.howland at gmail.com> wrote:> Hi, > > Just installed 0.9.4 (from 0.8 series) and ran the spec translator. It > messed up specs that had the should include() where the argument to > include is a string (using no parens for the arg) > > IOW, given: > context "OldSchool" do > class OldSchool > attr_accessor collection > def initialize > @collection = [] > end > def add_new(item) > @collection << item > end > end > > specify "should include string with ''?''" do > school = OldSchool.new > school.add_item ''like ?'' > school.collection.should_include ''like ?'' > end > end > > The resulting translation is: > > it "should include string with ''?''" do > school = OldSchool.new > school.add_item ''like ?'' > school.collection.should include(''like)?'' > end > > It works ok if the original line is parenthesized > school.collection.should_include(''like ?'') >you can submit a patch or bug report, but we might not fix it. we''re not aiming for a 100% perfect translator - just in the upper nineties. aslak> Ed > > > > > > > -- > Ed Howland > http://greenprogrammer.blogspot.com > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
On 5/10/07, aslak hellesoy <aslak.hellesoy at gmail.com> wrote:> On 5/10/07, Ed Howland <ed.howland at gmail.com> wrote: > > you can submit a patch or bug report, but we might not fix it. we''re > not aiming for a 100% perfect translator - just in the upper nineties. > > aslak >I''ll do a bug report. A note in the docs about this one should suffice for now. Just say your "should include args" the args to include should be parenthesized. Ed -- Ed Howland http://greenprogrammer.blogspot.com