Skip to content

Commit 404da94

Browse files
committed
test: add Some.new(nil) spec
1 parent e932289 commit 404da94

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

spec/rs/option_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
RSpec.describe(Rs::Option) do
44
# https://doc.rust-lang.org/std/option/enum.Option.html
55

6+
it "new" do
7+
expect { Some.new(nil) }.to(raise_error(Rs::Option::ArgumentError, "Some value cannot be nil"))
8+
end
9+
610
it "some?" do
711
x = Some.new(2)
812
expect(x.some?).to(be(true))

0 commit comments

Comments
 (0)