btakita / rr

RR (Double Ruby) is a test double framework that features a rich selection of double techniques and a terse syntax.
http://github.com/rr/rr
MIT License
501 stars 58 forks source link

new_instance_of raises uninitialized constant RR::DoubleDefinitions::DoubleInjections::NewInstanceOf #53

Closed hedgehog closed 11 years ago

hedgehog commented 13 years ago

As of rr 1.0.2, this:

  new_instance_of(Pathname) do |u|
    mock(u).exists {false}
  end

Raises:

NameError: uninitialized constant RR::DoubleDefinitions::DoubleInjections::NewInstanceOf
/home/hedge/.rvm/gems/ruby-1.9.2-p136@b3/gems/rr-1.0.2/lib/rr/adapters/rr_methods.rb:131:in `new_instance_of'
key88sf commented 13 years ago

I get the same error :(

artemas commented 13 years ago
NameError: uninitialized constant RR::DoubleDefinitions::DoubleInjections::NewInstanceOf
    /usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:442:in `load_missing_constant'
    /usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:77:in `const_missing'
    /usr/lib/ruby/gems/1.8/gems/rr-1.0.2/lib/rr/adapters/rr_methods.rb:131:in `new_instance_of'
pivotalneutron commented 13 years ago

Same here, looks like a file didn't get checked in.

quarterdome commented 13 years ago

and same here too :(

bartt commented 13 years ago

Ditto

camelpunch commented 13 years ago

Ditto.

jackdempsey commented 13 years ago

Anyone look in the code? Looks like it was intentionally removed:

+1.0.1 +- Removed new_instance_of for Ruby 1.9.2 compatibility. instance_of is now an alias for any_instance_of. +- Compatible with Ruby 1.9.2

Updated README is probably what's called for here.

nicolasmeunier commented 13 years ago

I just got this error again. If it was removed why is rr using it?

masukomi commented 12 years ago

Two issues related to this

rr_methods.rb line 130

  def new_instance_of(*args, &block)
    RR::DoubleDefinitions::DoubleInjections::NewInstanceOf.call(*args, &block)
  end

First, it's not been removed Second, there's no unit test covering this new_instance_of method. If there were it would be failing and alerting someone to either get rid of it or fix it.

Mock object and Unit test libraries have to be held to a much higher testing standard that typical code. This is the code we depend upon to make sure all our other code works. EVERY method needs to be tested. This is apparently not the case with RR... which makes me feel a bit uneasy.

petemounce commented 12 years ago

I have this error too, against rr 1.0.4.

ms-ati commented 12 years ago

Is this unmaintained abandonware now? Have folks moved on to a different library?

jackdempsey commented 12 years ago

Looks like the last commit was 9 months ago. Great project, would be a shame if no one picked it up and kept things going.

sfsekaran commented 12 years ago

Seriously, where'd the maintainers go? I'd submit a patch myself if I thought someone would pull it in.

masukomi commented 12 years ago

@sfsekaran use that pretty little fork button... Even if you only make that one patch yourself it's not much work to continue accepting other people's patches, and that would be better than the current state of things.

ndbroadbent commented 11 years ago

+1, new_instance_of is still broken. If I submit a pull request, is there someone who can accept it?

mcmire commented 11 years ago

We are back and this will finally get fixed in the next release. :)