1
0
Fork 0

fixed version check

This commit is contained in:
Frank Celler 2014-06-18 19:14:14 +02:00
parent 25e694f8ab
commit dd9f81ec82
1 changed files with 17 additions and 4 deletions

View File

@ -16,7 +16,7 @@ describe ArangoDB do
doc.code.should eq(200)
compatibility = doc.parsed_response['compatibility']
compatibility.should be_kind_of(Integer)
compatibility.should eq(20100)
compatibility.should eq(20200)
end
it "tests the compatibility value when a broken header is set" do
@ -28,7 +28,7 @@ describe ArangoDB do
doc.code.should eq(200)
compatibility = doc.parsed_response['compatibility']
compatibility.should be_kind_of(Integer)
compatibility.should eq(20100)
compatibility.should eq(20200)
end
end
@ -97,6 +97,19 @@ describe ArangoDB do
end
end
it "tests the compatibility value when a valid header is set" do
versions = [ "2.2.0", "2.2.0-devel", "2.2.0-alpha", "2.2", " 2.2", "2.2 ", " 2.2.0", " 2.2.0 ", "20200", "20200 ", "20299" ]
versions.each do|value|
doc = ArangoDB.get("/_admin/echo", :headers => { "x-arango-version" => value })
doc.code.should eq(200)
compatibility = doc.parsed_response['compatibility']
compatibility.should be_kind_of(Integer)
compatibility.should eq(20200)
end
end
it "tests the compatibility value when a too low version is set" do
versions = [ "0.0", "0.1", "0.2", "0.9", "1.0", "1.1", "1.2" ]
@ -111,12 +124,12 @@ describe ArangoDB do
end
it "tests the compatibility value when a too high version is set" do
doc = ArangoDB.get("/_admin/echo", :headers => { "x-arango-version" => "2.1" })
doc = ArangoDB.get("/_admin/echo", :headers => { "x-arango-version" => "2.3" })
doc.code.should eq(200)
compatibility = doc.parsed_response['compatibility']
compatibility.should be_kind_of(Integer)
compatibility.should eq(20100)
compatibility.should eq(20200)
end
end