I would really like to test java code using rspec under jruby, but I donβt see how to set expectations in the internal calls of the java method. Given the following java:
public class A { public String hi() { return hello(); } public String hello() { return "yo"; } }
I would like to be able to:
describe 'A' do it 'should call hello' do a = some.java.package.A.new a.should_receive(:hello).and_return('yello') a.hi end end
Is it possible to integrate the java mocking tool backstage to do this? Has anyone already done this? I don't care if I should use a different syntax to set the wait (instead of rspec 'should_receive'), but it should be at least brief.
source share