diff --git a/test/struct.test.rb b/test/struct.test.rb index 7b5a9c4..e06829a 100644 --- a/test/struct.test.rb +++ b/test/struct.test.rb @@ -4,6 +4,10 @@ class Person < Literal::Struct prop :name, String end +class Student < Person + prop :final_grade, Integer +end + test do person = Person.new(name: "Joel") expect(person.name) == "Joel" @@ -34,6 +38,13 @@ class Person < Literal::Struct expect(a) != b end +test do + a = Person.new(name: "Joel") + b = Student.new(name: "Joel", final_grade: 90) + + expect(a) != b +end + # Marshal doesn't work with anonymous classes class ::RootStruct < Literal::Struct prop :name, String