Testing a collection


Is there away to test a collection with rspec 1.3? I’ve seen Jim
Weirich’s rspec-collection, but it requires rspec 2.0. I’d like to go
to rspec 2.0, but have another dependency that will not work with
rspec 2.0. I may have to bite the bullet and see if I can update that
dependency to work wit rspec 2 and go to rspec 2.

What I’d like to do is:

describe “blah” do
subject { a-collection }

subjects.each do |s|
subject { s }

  it { should pass a test }


BTW: Using this to test a 3rd party app. Probably not the right
tool, but I like ruby and its tools. So, I have access to the app db
and send a message to the app via a service and need to see if things
changed the way I expected. I’d love to actually test without doing
it that way, but it would require Jruby to be able to mock java
objects and return those mocks in the java. If that was possible than
I’d test the java directly using jruby and rspec. I have tested some
java with rspec, but those java classes don’t involve db calls or
other communications that I’d like to mock. If the java class
involves any of those communications, I just have to write an
integration test with fixtures, sending the data and then testing

Any ideas other than find a java testing tool, because I just try to
avoid java but can’t since it is how I have to pay the bills. :frowning:



Have you looked at JTestR?
I’m not sure how active it is being developed and it might not do what
you are looking for… but it might be worth a shot.