Feature Requests: Browse | Submit New | Admin

[#5909] Underscored predicates don't work

Date:
2006-09-26 08:31
Priority:
5
Submitted By:
Aslak Hellesøy (aslak_hellesoy)
Assigned To:
David Chelimsky (dchelimsky)
Category:
None
State:
Closed
Summary:
Underscored predicates don't work

Detailed description
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'

Add A Comment: Notepad

Please login


Followup

Message
Date: 2006-09-26 23:02
Sender: David Chelimsky

Fixed.
Date: 2006-09-26 10:54
Sender: David Chelimsky

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).

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

Field Old Value Date By
status_idOpen2006-09-26 23:02dchelimsky
close_date2006-09-26 23:022006-09-26 23:02dchelimsky
assigned_tonone2006-09-26 10:54dchelimsky