[rspec-devel] [ rspec-Bugs-10750 ] spec_translator doesn't handle non_parenthesized arguments to expectations.

noreply at rubyforge.org noreply at rubyforge.org
Thu May 10 15:49:29 EDT 2007


Bugs item #10750, was opened at 2007-05-10 14:49
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3149&aid=10750&group_id=797

Category: None
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Ed Howland (edhowland)
Assigned to: Nobody (None)
Summary: spec_translator doesn't handle non_parenthesized arguments to expectations.

Initial Comment:
An example is .should include 'arg = ?'
This get translated to 
.should include('arg = )?'

Here is some before and after specs:
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 specify clause gets translated to:

 it "should include string with '?'" do
       school = OldSchool.new
       school.add_item 'like ?'
       school.collection.should include('like)?'
 end

Which ruby won't parse.

----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3149&aid=10750&group_id=797


More information about the rspec-devel mailing list