[rspec-devel] [ rspec-Feature Requests-5909 ] Underscored predicates don't work

noreply at rubyforge.org noreply at rubyforge.org
Tue Sep 26 19:02:12 EDT 2006


Feature Requests item #5909, was opened at 2006-09-26 08:31
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3152&aid=5909&group_id=797

Category: None
Group: None
>Status: Closed
Priority: 5
Submitted By: Aslak Hellesoy (aslak_hellesoy)
Assigned to: David Chelimsky (dchelimsky)
Summary: Underscored predicates don't work

Initial Comment:
The following fails:

class Bottle
  def contain_milk?
    true
  end
end

context "A new bottle" do
  specify "should contain milk" do
    Bottle.new.should_contain_milk
  end
end

It fails with:

NoMethodError in 'A new bottle should contain milk'
undefined method `contain?' for #<Bottle:0x2d41744>
./failing_examples\bottle_spec.rb:11:in `should contain milk'

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

>Comment By: David Chelimsky (dchelimsky)
Date: 2006-09-26 23:02

Message:
Fixed.

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

Comment By: David Chelimsky (dchelimsky)
Date: 2006-09-26 10:54

Message:
Turns out that it depends on the form. The following works:

target.should_multi_word_predicate

but these fail:

target.should_be_multi_word_predicate
target.should_not_multi_word_predicate
target.should_not_be_multi_word_predicate

IIRC, this was working correctly at one point. I've added tests to ensure that it keeps working once I've gotten the fix (in progress).

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

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


More information about the rspec-devel mailing list