mirror of
https://github.com/inspec/inspec
synced 2024-11-27 07:00:39 +00:00
improve testing for DataSeries#to_h and DataSeries#to_json
Signed-off-by: Miah Johnson <miah@chia-pet.org>
This commit is contained in:
parent
55ea2d984c
commit
5adf33469a
1 changed files with 3 additions and 0 deletions
|
@ -34,12 +34,15 @@ class TestTelemetryDataSeries < Minitest::Test
|
|||
ds = Inspec::Telemetry::DataSeries.new('fizz')
|
||||
ds << 'foo'
|
||||
assert_kind_of Hash, ds.to_h
|
||||
assert_equal 'fizz', ds.to_h[:name]
|
||||
assert_equal ['foo'], ds.to_h[:data]
|
||||
end
|
||||
|
||||
def test_to_json
|
||||
ds = Inspec::Telemetry::DataSeries.new('fizz')
|
||||
ds << 'foo'
|
||||
assert_kind_of String, ds.to_json
|
||||
assert_equal '{"name":"fizz","data":["foo"]}', ds.to_json
|
||||
assert JSON.parse(ds.to_json)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue