Add extra test cases

This commit is contained in:
Stuart Frost 2023-07-27 09:29:28 +01:00
parent e85531df6c
commit b2069ea4ff
1 changed files with 18 additions and 0 deletions

View File

@ -51,6 +51,24 @@ module Ameba
subject.expand(["foo/*"])
end
end
it "raises an ArgumentError when given a missing file" do
expect_raises(ArgumentError, "No files found matching foo.cr") do
subject.expand(["foo.cr"])
end
end
it "raises an ArgumentError when given a missing directory" do
expect_raises(ArgumentError, "No files found matching foo/") do
subject.expand(["foo/"])
end
end
it "raises an ArgumentError when given multiple arguments, one of which is missing" do
expect_raises(ArgumentError, "No files found matching foo.cr") do
subject.expand(["**/#{current_file_basename}", "foo.cr"])
end
end
end
end
end