Skip to content

Commit

Permalink
test: add test for Package#valid?
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jan 11, 2025
1 parent 811e446 commit 387d14a
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions test/test-package.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,32 @@ def test_operator_less_than
end
end

sub_test_case("#valid?") do
def test_id_only
assert do
Package.new("cairo").valid?
end
end

def test_empty_id
assert do
not Package.new("").valid?
end
end

def test_operator_only
assert do
not Package.new("cairo", ">").valid?
end
end

def test_full
assert do
Package.new("cairo", ">", "1.0.0").valid?
end
end
end

sub_test_case("#satisfied?") do
def test_no_required_version
assert do
Expand Down

0 comments on commit 387d14a

Please sign in to comment.