baza.rb 0.10.1 → 0.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +3 -3
- data/Gemfile.lock +28 -28
- data/baza.rb.gemspec +3 -3
- data/lib/baza-rb/version.rb +1 -1
- data/lib/baza-rb.rb +20 -19
- metadata +6 -28
- data/.0pdd.yml +0 -8
- data/.gitattributes +0 -7
- data/.github/workflows/actionlint.yml +0 -25
- data/.github/workflows/codecov.yml +0 -25
- data/.github/workflows/copyrights.yml +0 -19
- data/.github/workflows/markdown-lint.yml +0 -23
- data/.github/workflows/pdd.yml +0 -19
- data/.github/workflows/rake.yml +0 -29
- data/.github/workflows/reuse.yml +0 -19
- data/.github/workflows/typos.yml +0 -19
- data/.github/workflows/xcop.yml +0 -19
- data/.github/workflows/yamllint.yml +0 -21
- data/.gitignore +0 -11
- data/.pdd +0 -7
- data/.rubocop.yml +0 -55
- data/.rultor.yml +0 -26
- data/.simplecov +0 -24
- data/.yamllint.yml +0 -7
- data/renovate.json +0 -6
- data/test/test__helper.rb +0 -32
- data/test/test_baza-rb.rb +0 -821
- data/test/test_fake.rb +0 -135
data/test/test_fake.rb
DELETED
@@ -1,135 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 Zerocracy
|
4
|
-
# SPDX-License-Identifier: MIT
|
5
|
-
|
6
|
-
require_relative 'test__helper'
|
7
|
-
require_relative '../lib/baza-rb/fake'
|
8
|
-
|
9
|
-
# Test fake object.
|
10
|
-
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
11
|
-
# Copyright:: Copyright (c) 2024-2025 Yegor Bugayenko
|
12
|
-
# License:: MIT
|
13
|
-
class TestFake < Minitest::Test
|
14
|
-
def test_whoami
|
15
|
-
baza = BazaRb::Fake.new
|
16
|
-
nick = baza.whoami
|
17
|
-
refute_nil(nick)
|
18
|
-
end
|
19
|
-
|
20
|
-
def test_balance
|
21
|
-
baza = BazaRb::Fake.new
|
22
|
-
z = baza.balance
|
23
|
-
refute_nil(z)
|
24
|
-
end
|
25
|
-
|
26
|
-
def test_pull
|
27
|
-
baza = BazaRb::Fake.new
|
28
|
-
bin = baza.pull(42)
|
29
|
-
refute_nil(bin)
|
30
|
-
end
|
31
|
-
|
32
|
-
def test_push
|
33
|
-
baza = BazaRb::Fake.new
|
34
|
-
id = baza.push('test-job', 'test-data', [])
|
35
|
-
assert_equal(42, id)
|
36
|
-
end
|
37
|
-
|
38
|
-
def test_finished
|
39
|
-
baza = BazaRb::Fake.new
|
40
|
-
assert(baza.finished?(42))
|
41
|
-
end
|
42
|
-
|
43
|
-
def test_stdout
|
44
|
-
baza = BazaRb::Fake.new
|
45
|
-
output = baza.stdout(42)
|
46
|
-
assert_equal('Fake stdout output', output)
|
47
|
-
end
|
48
|
-
|
49
|
-
def test_exit_code
|
50
|
-
baza = BazaRb::Fake.new
|
51
|
-
code = baza.exit_code(42)
|
52
|
-
assert_equal(0, code)
|
53
|
-
end
|
54
|
-
|
55
|
-
def test_verified
|
56
|
-
baza = BazaRb::Fake.new
|
57
|
-
verdict = baza.verified(42)
|
58
|
-
assert_equal('fake-verdict', verdict)
|
59
|
-
end
|
60
|
-
|
61
|
-
def test_lock_unlock
|
62
|
-
baza = BazaRb::Fake.new
|
63
|
-
baza.lock('test-job', 'test-owner')
|
64
|
-
baza.unlock('test-job', 'test-owner')
|
65
|
-
end
|
66
|
-
|
67
|
-
def test_recent
|
68
|
-
baza = BazaRb::Fake.new
|
69
|
-
id = baza.recent('test-job')
|
70
|
-
assert_equal(42, id)
|
71
|
-
end
|
72
|
-
|
73
|
-
def test_name_exists
|
74
|
-
baza = BazaRb::Fake.new
|
75
|
-
assert(baza.name_exists?('test-job'))
|
76
|
-
end
|
77
|
-
|
78
|
-
def test_durable_operations
|
79
|
-
baza = BazaRb::Fake.new
|
80
|
-
Dir.mktmpdir do |tmp|
|
81
|
-
f = File.join(tmp, 'test.bin')
|
82
|
-
File.write(f, 'hello')
|
83
|
-
baza.durable_place('test-job', f)
|
84
|
-
baza.durable_save(42, f)
|
85
|
-
baza.durable_load(42, f)
|
86
|
-
baza.durable_lock(42, 'test-owner')
|
87
|
-
baza.durable_unlock(42, 'test-owner')
|
88
|
-
end
|
89
|
-
end
|
90
|
-
|
91
|
-
def test_transfer
|
92
|
-
baza = BazaRb::Fake.new
|
93
|
-
receipt_id = baza.transfer('recipient', 1.0, 'test-payment')
|
94
|
-
assert_equal(42, receipt_id)
|
95
|
-
end
|
96
|
-
|
97
|
-
def test_pays_fee
|
98
|
-
baza = BazaRb::Fake.new
|
99
|
-
receipt_id = baza.fee('unknown', 43.0, 'for fun', 44)
|
100
|
-
assert_equal(42, receipt_id)
|
101
|
-
end
|
102
|
-
|
103
|
-
def test_pop
|
104
|
-
baza = BazaRb::Fake.new
|
105
|
-
Dir.mktmpdir do |tmp|
|
106
|
-
f = File.join(tmp, 'test.zip')
|
107
|
-
result = baza.pop('test-owner', f)
|
108
|
-
assert(result)
|
109
|
-
end
|
110
|
-
end
|
111
|
-
|
112
|
-
def test_finish
|
113
|
-
baza = BazaRb::Fake.new
|
114
|
-
Dir.mktmpdir do |tmp|
|
115
|
-
f = File.join(tmp, 'test.zip')
|
116
|
-
File.write(f, 'hello')
|
117
|
-
baza.finish(42, f)
|
118
|
-
end
|
119
|
-
end
|
120
|
-
|
121
|
-
def test_enter
|
122
|
-
baza = BazaRb::Fake.new
|
123
|
-
result =
|
124
|
-
baza.enter('test-job', 'test-badge', 'test-reason', 42) do
|
125
|
-
'test-result'
|
126
|
-
end
|
127
|
-
assert_equal('test-result', result)
|
128
|
-
end
|
129
|
-
|
130
|
-
def test_csrf
|
131
|
-
baza = BazaRb::Fake.new
|
132
|
-
token = baza.csrf
|
133
|
-
assert_equal('fake-csrf-token', token)
|
134
|
-
end
|
135
|
-
end
|