diff --git a/spec/java_integration/fixtures/iface/SingleMethodIfaceWith2Args.java b/spec/java_integration/fixtures/iface/SingleMethodIfaceWith2Args.java deleted file mode 100644 index dff80007e60..00000000000 --- a/spec/java_integration/fixtures/iface/SingleMethodIfaceWith2Args.java +++ /dev/null @@ -1,11 +0,0 @@ -package java_integration.fixtures.iface; - -public interface SingleMethodIfaceWith2Args { - public static class Caller { - public static void call(SingleMethodIfaceWith2Args iface) { - iface.doSome("hello", 42); - } - } - - void doSome(final String arg1, final V arg2); -} diff --git a/spec/java_integration/fixtures/iface/SingleMethodInterfaceWithArg.java b/spec/java_integration/fixtures/iface/SingleMethodInterfaceWithArg.java new file mode 100644 index 00000000000..031b7e4cd5f --- /dev/null +++ b/spec/java_integration/fixtures/iface/SingleMethodInterfaceWithArg.java @@ -0,0 +1,14 @@ +package java_integration.fixtures.iface; + +public interface SingleMethodInterfaceWithArg { + public static class Caller { + public static void call(SingleMethodInterfaceWithArg iface) { + call(42, iface); + } + public static void call(V arg, SingleMethodInterfaceWithArg iface) { + iface.doSome(arg); + } + } + + void doSome(final V arg) ; +} diff --git a/spec/java_integration/interfaces/implementation_spec.rb b/spec/java_integration/interfaces/implementation_spec.rb index ec65251456d..17dc41c9043 100644 --- a/spec/java_integration/interfaces/implementation_spec.rb +++ b/spec/java_integration/interfaces/implementation_spec.rb @@ -190,15 +190,16 @@ def callIt end it "passes correct arguments to proc .impl" do - Java::java.io.File.new('.').listFiles do |pathname| - pathname.should be_kind_of(java.io.File) - true + Java::java.io.File.new('.').list do |dir, name| # FilenameFilter + dir.should be_kind_of(java.io.File) + name.should be_kind_of(String) + true # boolean accept(File dir, String name) end - Java::java_integration.fixtures.iface.SingleMethodIfaceWith2Args::Caller.call do |arg1, arg2| - arg1.should == 'hello' - arg2.should == 42 - end + caller = Java::java_integration.fixtures.iface.SingleMethodInterfaceWithArg::Caller + + caller.call { |arg| arg.should == 42 } + caller.call('x') { |arg| arg.should == 'x' } end it "should maintain Ruby object equality when passed through Java and back" do