We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7d8998a commit e242595Copy full SHA for e242595
core/data/fixtures/classes.rb
@@ -9,5 +9,13 @@ def self.name
9
end
10
11
class DataSubclass < Data; end
12
+
13
+ MeasureSubclass = Class.new(Measure) do
14
+ def initialize(amount:, unit:)
15
+ super
16
+ end
17
18
19
+ Empty = Data.define()
20
21
core/data/initialize_spec.rb
@@ -60,4 +60,15 @@
60
e.message.should.include?("unknown keyword: :system")
61
}
62
63
64
+ it "supports super from a subclass" do
65
+ ms = DataSpecs::MeasureSubclass.new(amount: 1, unit: "km")
66
67
+ ms.amount.should == 1
68
+ ms.unit.should == "km"
69
70
71
+ it "supports Data with no fields" do
72
+ -> { DataSpecs::Empty.new }.should_not raise_error
73
74
0 commit comments