riak-ripple / ripple

A rich Ruby modeling layer for Riak, Basho's distributed database
Other
618 stars 152 forks source link

RSpec example fails after updating rspec and ammeter dependencies #320

Closed smangelsdorf closed 11 years ago

smangelsdorf commented 11 years ago

I'm working on Rails 4 support for this library, and I've hit a small issue with a failing test case. I've tracked the problem back to the same test case failing on the master branch if the dependencies are updated.

I'm happy to continue investigating this, but I can't understand why the assertions in this test case are valid. I was hoping someone could shed some light on it for me.

The failure is many_reference_proxy_spec.rb:145:

  1) Ripple::Associations::ManyReferenceProxy#keys maintains the list of keys properly as new documents are appended
     Failure/Error: @account.payment_methods.should have(1).key
       expected 1 key, got 3
      # ./spec/ripple/associations/many_reference_proxy_spec.rb:148:in `block (3 levels) in <top (required)>'

As far as I can see, the @keys collection in ManyReferenceProxy doesn't get updated when << is called, so there will always be 3 keys (1, 2 and 3 as returned by the mock defined at line 120).

Anyone able to offer some advice?

smangelsdorf commented 11 years ago

Travis build shows the same failure I'm seeing (in addition to the case that always fails).

smangelsdorf commented 11 years ago

I'm no longer concerned about this. Closing.