From f0e5c4047df8516175d7788bfd16ed7a9be26e42 Mon Sep 17 00:00:00 2001 From: Herwin Date: Wed, 25 Sep 2024 11:32:47 +0200 Subject: [PATCH] Add specs for Data#to_h --- core/data/to_h_test.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 core/data/to_h_test.rb diff --git a/core/data/to_h_test.rb b/core/data/to_h_test.rb new file mode 100644 index 000000000..55277a3f9 --- /dev/null +++ b/core/data/to_h_test.rb @@ -0,0 +1,11 @@ +require_relative '../../spec_helper' +require_relative 'fixtures/classes' + +ruby_version_is "3.2" do + describe "Data#to_h" do + it "transforms the data object into a hash" do + data = DataSpecs::Measure.new(amount: 42, unit: 'km') + data.to_h.should == { amount: 42, unit: 'km' } + end + end +end