Bugs: Browse | Submit New | Admin

[#18917] any_of seems to be broken

Date:
2008-03-18 16:09
Priority:
3
Submitted By:
Shane Harvie (sharvie)
Assigned To:
Nobody (None)
Category:
None
State:
Closed
Summary:
any_of seems to be broken

Detailed description
Example:

require 'rubygems'
gem 'mocha'
require 'mocha'

require 'test/unit'

class Foo
  def foo(var)
    
  end
end

class FooTest < Test::Unit::TestCase
  def test_anything
    f = Foo.new
    f.expects(:foo).with(
      any_of("blah", "stuff")
    )
    f.foo("blah")
  end
end

 1) Error:
test_anything(FooTest):
NoMethodError: undefined method `matches?' for "blah":String
method matches? in any_of.rb at line 36
method any? in class_method.rb at line 33
method each in any_of.rb at line 36
method any? in any_of.rb at line 36
method matches? in any_of.rb at line 36
method parameters_match? in parameters_matcher.rb at line 21
method all? in class_method.rb at line 33
method each in parameters_matcher.rb at line 21
method all? in parameters_matcher.rb at line 21
method parameters_match? in parameters_matcher.rb at line 21
method match? in parameters_matcher.rb at line 16
method match? in expectation.rb at line 333
method detect in expectation_list.rb at line 23
method select in expectation_list.rb at line 23
method detect in expectation_list.rb at line 23
method method_missing in mock.rb at line 158
method foo in (eval) at line 1
method test_anything in mocha_failures.rb at line 19
method __send__ in test_case_adapter.rb at line 19
method run in test_case_adapter.rb at line 19

Add A Comment: Notepad

Please login


Followup

Message
Date: 2008-03-18 21:00
Sender: James Mead

Fixed in revision 295. Thanks for the bug report. I'm closing
this - please re-open if it's not fixed for you.

Cheers, James.
http://blog.floehopper.org
Date: 2008-03-18 21:00
Sender: James Mead

Fixed in revision 295. Thanks for the bug report. I'm closing
this - please re-open if it's not fixed for you.

Cheers, James.
http://blog.floehopper.org

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

Field Old Value Date By
status_idOpen2008-03-18 21:00jamesmead
close_date2008-03-18 21:002008-03-18 21:00jamesmead