[rspec-users] Problem with translator

Ed Howland ed.howland at gmail.com
Thu May 10 10:37:02 EDT 2007


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


More information about the rspec-users mailing list