From 695ef940652403e2494f60547d4647e340242ad6 Mon Sep 17 00:00:00 2001 From: Kostiantyn Kostiuk Date: Thu, 29 Feb 2024 18:53:16 +0200 Subject: [PATCH] rspec: Check that all jsons can be loaded into struct Signed-off-by: Kostiantyn Kostiuk --- spec/srb_json_load_spec.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 spec/srb_json_load_spec.rb diff --git a/spec/srb_json_load_spec.rb b/spec/srb_json_load_spec.rb new file mode 100644 index 00000000..cbf972e9 --- /dev/null +++ b/spec/srb_json_load_spec.rb @@ -0,0 +1,21 @@ +require 'json' + +require './lib/models/driver' + +describe 'srb_json_load' do + Dir['./**/*.json'].each do |json_file| + next if json_file.include? 'jtd.json' + + it json_file.to_s do + data = nil + if json_file.include? 'lib/engines/hcktest/drivers' + data = AutoHCK::Models::Driver.from_json_file(json_file) + else + pending("NO TYPE FOR #{json_file}") + raise + end + + expect(data).not_to be_nil + end + end +end