Skip to content

Commit 7830b40

Browse files
committed
Improved tests [skip ci]
1 parent 26c0999 commit 7830b40

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/booster_test.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ def test_predict_daru
5757
])
5858
pred = booster.predict(x_test)
5959
assert_elements_in_delta [0.9823112229173586, 0.9583143724610858], pred.first(2)
60+
61+
assert_raises(IndexError) do
62+
booster.predict(Daru::DataFrame.new([{"x0" => 3.7}]))
63+
end
6064
end
6165

6266
def test_predict_rover
@@ -68,6 +72,10 @@ def test_predict_rover
6872
])
6973
pred = booster.predict(x_test)
7074
assert_elements_in_delta [0.9823112229173586, 0.9583143724610858], pred.first(2)
75+
76+
assert_raises(KeyError) do
77+
booster.predict(Rover::DataFrame.new([{"x0" => 3.7}]))
78+
end
7179
end
7280

7381
def test_model_to_string

0 commit comments

Comments
 (0)