|
|
|
@ -387,5 +387,19 @@ class DocsDocTest < MiniTest::Spec
|
|
|
|
|
assert_equal ['https://4'], version.links
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
it "compares versions" do
|
|
|
|
|
instance = doc.versions.first.new
|
|
|
|
|
assert !instance.is_outdated('1', '1')
|
|
|
|
|
assert !instance.is_outdated('1.2', '1.2')
|
|
|
|
|
assert !instance.is_outdated('1.2.2', '1.2.2')
|
|
|
|
|
assert !instance.is_outdated('1.2.2', '1.2.3')
|
|
|
|
|
assert instance.is_outdated('1', '2')
|
|
|
|
|
assert instance.is_outdated('1.2', '1.3')
|
|
|
|
|
assert instance.is_outdated('9', '10')
|
|
|
|
|
assert instance.is_outdated('99', '101')
|
|
|
|
|
assert !instance.is_outdated('2006-01-02', '2006-01-03')
|
|
|
|
|
assert instance.is_outdated('2006-01-02', '2006-02-03')
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|