Skip to content

Commit

Permalink
Update luatest to 0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mmelentiev-mail authored and printercu committed Oct 25, 2019
1 parent ffb110e commit f23fd08
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 22 deletions.
2 changes: 1 addition & 1 deletion Makefile
@@ -1,7 +1,7 @@
bootstrap: .rocks

.rocks:
tarantoolctl rocks install luatest 0.2.0
tarantoolctl rocks install luatest 0.3.0
tarantoolctl rocks install luacheck 0.25.0

tmp/sdk-1.10:
Expand Down
2 changes: 1 addition & 1 deletion examples/getting-started-app/README.md
Expand Up @@ -641,7 +641,7 @@ source = {
dependencies = {
'tarantool',
'lua >= 5.1',
'luatest == 0.2.0-1',
'luatest == 0.3.0-1',
'cartridge == 1.2.0-1',
'ldecnumber == 1.1.3-1',
}
Expand Down
2 changes: 1 addition & 1 deletion examples/getting-started-app/README_RUS.md
Expand Up @@ -643,7 +643,7 @@ source = {
dependencies = {
'tarantool',
'lua >= 5.1',
'luatest == 0.2.0-1',
'luatest == 0.3.0-1',
'cartridge == 1.2.0-1',
'ldecnumber == 1.1.3-1',
}
Expand Down
Expand Up @@ -7,7 +7,7 @@ source = {
dependencies = {
'tarantool',
'lua >= 5.1',
'luatest == 0.2.0-1',
'luatest == 0.3.0-1',
'ldecnumber == 1.1.3-1',
'cartridge == 1.2.0-1',
}
Expand Down
16 changes: 7 additions & 9 deletions examples/getting-started-app/test/integration/api_test.lua
Expand Up @@ -7,13 +7,11 @@ local cluster = helper.cluster

local function assert_http_json_request(method, path, body, expected)
checks('string', 'string', '?table', 'table')
local response = cluster.main_server:http_request(method, path,
{
json=body,
headers={["content-type"]="application/json; charset=utf-8"},
raw=true
}
)
local response = cluster.main_server:http_request(method, path, {
json = body,
headers = {["content-type"]="application/json; charset=utf-8"},
raise = false
})

if expected.body then
t.assert_equals(response.json, expected.body)
Expand Down Expand Up @@ -120,6 +118,6 @@ g.test_transaction_chain = function()
)

t.assert(response.json.balance)
t.assert_almost_equals(tonumber(response.json.balance), accumulator[acc_id], 10-5)
t.assert_almost_equals(tonumber(response.json.balance), accumulator[acc_id], math.pow(10, -5))
end
end
end
10 changes: 5 additions & 5 deletions examples/getting-started-app/test/unit/sample_test.lua
Expand Up @@ -6,10 +6,10 @@ local storage_utils = require('app.roles.storage').utils
require('test.helper.unit')

g.test_update_balance = function()
t.assertEquals(storage_utils.update_balance("88.95", 0.455), "89.40")
t.assertEquals(storage_utils.update_balance("88.95", 0.455001), "89.41")
t.assert_equals(storage_utils.update_balance("88.95", 0.455), "89.40")
t.assert_equals(storage_utils.update_balance("88.95", 0.455001), "89.41")

t.assertEquals(storage_utils.update_balance("-18.99", 1.79), "-17.20")
t.assertEquals(storage_utils.update_balance("88.95", 1.79), "90.74")
t.assertEquals(storage_utils.update_balance("0.1", -0.2), "-0.10")
t.assert_equals(storage_utils.update_balance("-18.99", 1.79), "-17.20")
t.assert_equals(storage_utils.update_balance("88.95", 1.79), "90.74")
t.assert_equals(storage_utils.update_balance("0.1", -0.2), "-0.10")
end
2 changes: 1 addition & 1 deletion templates/cartridge/${project_name_lower}-scm-1.rockspec
Expand Up @@ -7,7 +7,7 @@ source = {
dependencies = {
'tarantool',
'lua >= 5.1',
'luatest == 0.2.0-1',
'luatest == 0.3.0-1',
'cartridge == 1.2.0-1',
}
build = {
Expand Down
2 changes: 1 addition & 1 deletion templates/cartridge/test/integration/api_test.lua
Expand Up @@ -5,7 +5,7 @@ local helper = require('test.helper.integration')
local cluster = helper.cluster

g.test_sample = function()
t.assertEquals(
t.assert_equals(
cluster.main_server:http_request('post', '/admin/api', {json = {query = '{}'}}).json,
{data = {}}
)
Expand Down
2 changes: 1 addition & 1 deletion templates/cartridge/test/unit/sample_test.lua
Expand Up @@ -4,5 +4,5 @@ local g = t.group('unit_sample')
require('test.helper.unit')

g.test_sample = function()
t.assertEquals(type(box.cfg), 'table')
t.assert_equals(type(box.cfg), 'table')
end
2 changes: 1 addition & 1 deletion templates/plain/${project_name_lower}-scm-1.rockspec
Expand Up @@ -7,7 +7,7 @@ source = {
dependencies = {
'tarantool',
'lua >= 5.1',
'luatest == 0.2.0-1',
'luatest == 0.3.0-1',
}
build = {
type = 'none'
Expand Down

0 comments on commit f23fd08

Please sign in to comment.