Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
n-rodriguez committed May 2, 2024
1 parent 16f9db7 commit 66eea66
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions spec/fixtures/input_ucl_invalid.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
string: "bar,
true = true
false = false
nil: null
integer 1864
double 23.42
time: 10s
7 changes: 7 additions & 0 deletions spec/ucl/decoder_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,12 @@ describe UCL::Decoder do
input_ucl_conf = File.read("spec/fixtures/input_ucl.conf")
UCL::Decoder.decode(input_ucl_conf).should eq(OUTPUT_OBJECT)
end

it "should raise error on invalid UCL conf" do
input_ucl_conf = File.read("spec/fixtures/input_ucl_invalid.conf")
expect_raises(UCL::Error::DecoderError) do
UCL::Decoder.decode(input_ucl_conf)
end
end
end
end

0 comments on commit 66eea66

Please sign in to comment.