Skip to content

Commit ccb0757

Browse files
committed
Add test for interface impl with specialized superclass
See jruby#8412
1 parent 97ae862 commit ccb0757

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

spec/java_integration/interfaces/implementation_spec.rb

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -827,6 +827,25 @@ def bar
827827

828828
expect(java_cls.interfaces).to include(java.lang.Runnable.java_class)
829829
end
830+
831+
832+
describe "that extends a specializable RubyObject" do
833+
class C1
834+
end
835+
836+
it "produces a Java class that extends that specialized type" do
837+
# construct C1 first to use specialized class
838+
c1obj = C1.new
839+
840+
c2 = Class.new(C1) do
841+
include ReturnsInterface
842+
end
843+
844+
c2obj = c2.new
845+
846+
expect(JRuby.ref(c2obj).getClass.getSuperclass).to eq(JRuby.ref(c1obj).getClass)
847+
end
848+
end
830849
end
831850

832851
describe "A class that extends a DelegateClass" do

0 commit comments

Comments
 (0)