fbe 0.0.85 → 0.0.86
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/.0pdd.yml +1 -1
- data/.github/workflows/actionlint.yml +1 -1
- data/.github/workflows/codecov.yml +2 -2
- data/.github/workflows/copyrights.yml +1 -1
- data/.github/workflows/markdown-lint.yml +1 -1
- data/.github/workflows/pdd.yml +1 -1
- data/.github/workflows/rake.yml +1 -1
- data/.github/workflows/xcop.yml +1 -1
- data/.github/workflows/yamllint.yml +1 -1
- data/.gitignore +1 -1
- data/.rubocop.yml +6 -1
- data/.rultor.yml +1 -1
- data/.simplecov +1 -1
- data/.yamllint.yml +1 -1
- data/Gemfile +4 -3
- data/Gemfile.lock +46 -33
- data/LICENSE.txt +1 -1
- data/Rakefile +1 -1
- data/assets/bylaws/dud-was-punished.liquid +1 -1
- data/fbe.gemspec +2 -2
- data/lib/fbe/award.rb +28 -10
- data/lib/fbe/bylaws.rb +1 -1
- data/lib/fbe/conclude.rb +3 -3
- data/lib/fbe/copy.rb +1 -1
- data/lib/fbe/enter.rb +1 -1
- data/lib/fbe/fb.rb +1 -1
- data/lib/fbe/github_graph.rb +2 -2
- data/lib/fbe/if_absent.rb +2 -2
- data/lib/fbe/issue.rb +1 -1
- data/lib/fbe/iterate.rb +2 -2
- data/lib/fbe/just_one.rb +2 -2
- data/lib/fbe/middleware/formatter.rb +2 -2
- data/lib/fbe/middleware/quota.rb +2 -2
- data/lib/fbe/middleware.rb +2 -2
- data/lib/fbe/octo.rb +4 -4
- data/lib/fbe/overwrite.rb +2 -2
- data/lib/fbe/pmp.rb +1 -1
- data/lib/fbe/regularly.rb +1 -1
- data/lib/fbe/repeatedly.rb +1 -1
- data/lib/fbe/sec.rb +1 -1
- data/lib/fbe/unmask_repos.rb +1 -1
- data/lib/fbe/who.rb +1 -1
- data/lib/fbe.rb +3 -3
- data/rules/basic.fe +1 -1
- data/test/fbe/middleware/test_formatter.rb +10 -8
- data/test/fbe/middleware/test_quota.rb +1 -1
- data/test/fbe/test_award.rb +6 -6
- data/test/fbe/test_bylaws.rb +5 -5
- data/test/fbe/test_conclude.rb +2 -2
- data/test/fbe/test_copy.rb +3 -3
- data/test/fbe/test_enter.rb +2 -2
- data/test/fbe/test_fb.rb +7 -7
- data/test/fbe/test_github_graph.rb +17 -17
- data/test/fbe/test_if_absent.rb +6 -6
- data/test/fbe/test_issue.rb +2 -2
- data/test/fbe/test_iterate.rb +2 -2
- data/test/fbe/test_just_one.rb +3 -3
- data/test/fbe/test_octo.rb +10 -10
- data/test/fbe/test_overwrite.rb +3 -3
- data/test/fbe/test_pmp.rb +3 -3
- data/test/fbe/test_regularly.rb +2 -2
- data/test/fbe/test_repeatedly.rb +2 -2
- data/test/fbe/test_sec.rb +2 -2
- data/test/fbe/test_unmask_repos.rb +6 -6
- data/test/fbe/test_who.rb +2 -2
- data/test/test__helper.rb +1 -1
- data/test/test_fbe.rb +3 -3
- metadata +6 -6
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2024 Zerocracy
|
5
|
+
# Copyright (c) 2024-2025 Zerocracy
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"), to deal
|
@@ -29,7 +29,7 @@ require_relative '../../fbe/middleware'
|
|
29
29
|
# Faraday logging formatter show verbose log for only error response
|
30
30
|
#
|
31
31
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
32
|
-
# Copyright:: Copyright (c) 2024 Zerocracy
|
32
|
+
# Copyright:: Copyright (c) 2024-2025 Zerocracy
|
33
33
|
# License:: MIT
|
34
34
|
class Fbe::Middleware::Formatter < Faraday::Logging::Formatter
|
35
35
|
# Log HTTP request.
|
data/lib/fbe/middleware/quota.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2024 Zerocracy
|
5
|
+
# Copyright (c) 2024-2025 Zerocracy
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"), to deal
|
@@ -27,7 +27,7 @@ require 'faraday'
|
|
27
27
|
# Faraday Middleware that monitors GitHub API rate limits.
|
28
28
|
#
|
29
29
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
30
|
-
# Copyright:: Copyright (c) 2024 Zerocracy
|
30
|
+
# Copyright:: Copyright (c) 2024-2025 Zerocracy
|
31
31
|
# License:: MIT
|
32
32
|
class Fbe::Middleware::Quota < Faraday::Middleware
|
33
33
|
def initialize(app, loog: Loog::NULL, pause: 60, limit: 100, rate: 5)
|
data/lib/fbe/middleware.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2024 Zerocracy
|
5
|
+
# Copyright (c) 2024-2025 Zerocracy
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"), to deal
|
@@ -27,7 +27,7 @@ require_relative '../fbe'
|
|
27
27
|
# The module.
|
28
28
|
#
|
29
29
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
30
|
-
# Copyright:: Copyright (c) 2024 Zerocracy
|
30
|
+
# Copyright:: Copyright (c) 2024-2025 Zerocracy
|
31
31
|
# License:: MIT
|
32
32
|
module Fbe::Middleware
|
33
33
|
# empty
|
data/lib/fbe/octo.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2024 Zerocracy
|
5
|
+
# Copyright (c) 2024-2025 Zerocracy
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"), to deal
|
@@ -145,7 +145,7 @@ class Fbe::FakeOctokit
|
|
145
145
|
|
146
146
|
def name_to_number(name)
|
147
147
|
return name unless name.is_a?(String)
|
148
|
-
name.chars.
|
148
|
+
name.chars.sum(&:ord)
|
149
149
|
end
|
150
150
|
|
151
151
|
def rate_limit
|
@@ -1145,7 +1145,7 @@ class Fbe::FakeOctokit
|
|
1145
1145
|
started_at: '2024-08-18T08:04:44Z',
|
1146
1146
|
completed_at: '2024-08-18T08:20:17Z'
|
1147
1147
|
}
|
1148
|
-
].
|
1148
|
+
].find { |json| json[:id] == job } || {
|
1149
1149
|
id: job,
|
1150
1150
|
run_id: 1234,
|
1151
1151
|
name: 'run job',
|
@@ -1218,7 +1218,7 @@ class Fbe::FakeOctokit
|
|
1218
1218
|
run_started_at: '2024-08-18T08:04:44Z',
|
1219
1219
|
completed_at: '2024-08-18T08:20:17Z'
|
1220
1220
|
}
|
1221
|
-
].
|
1221
|
+
].find { |json| json[:id] == id } || {
|
1222
1222
|
id:,
|
1223
1223
|
name: 'copyrights',
|
1224
1224
|
head_branch: 'master',
|
data/lib/fbe/overwrite.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2024 Zerocracy
|
5
|
+
# Copyright (c) 2024-2025 Zerocracy
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"), to deal
|
@@ -54,7 +54,7 @@ def Fbe.overwrite(fact, property, value, fb: Fbe.fb)
|
|
54
54
|
before.each do |k, vv|
|
55
55
|
next unless n[k].nil?
|
56
56
|
vv.each do |v|
|
57
|
-
n.send("#{k}=", v)
|
57
|
+
n.send(:"#{k}=", v)
|
58
58
|
end
|
59
59
|
end
|
60
60
|
n
|
data/lib/fbe/pmp.rb
CHANGED
data/lib/fbe/regularly.rb
CHANGED
data/lib/fbe/repeatedly.rb
CHANGED
data/lib/fbe/sec.rb
CHANGED
data/lib/fbe/unmask_repos.rb
CHANGED
data/lib/fbe/who.rb
CHANGED
data/lib/fbe.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2024 Zerocracy
|
3
|
+
# Copyright (c) 2024-2025 Zerocracy
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
@@ -23,9 +23,9 @@
|
|
23
23
|
# The main and only module of this gem.
|
24
24
|
#
|
25
25
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
26
|
-
# Copyright:: Copyright (c) 2024 Zerocracy
|
26
|
+
# Copyright:: Copyright (c) 2024-2025 Zerocracy
|
27
27
|
# License:: MIT
|
28
28
|
module Fbe
|
29
29
|
# Current version of the gem (changed by +.rultor.yml+ on every release)
|
30
|
-
VERSION = '0.0.
|
30
|
+
VERSION = '0.0.86'
|
31
31
|
end
|
data/rules/basic.fe
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2024 Zerocracy
|
5
|
+
# Copyright (c) 2024-2025 Zerocracy
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"), to deal
|
@@ -31,7 +31,7 @@ require_relative '../../../lib/fbe/middleware/formatter'
|
|
31
31
|
|
32
32
|
# Test.
|
33
33
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
34
|
-
# Copyright:: Copyright (c) 2024 Zerocracy
|
34
|
+
# Copyright:: Copyright (c) 2024-2025 Zerocracy
|
35
35
|
# License:: MIT
|
36
36
|
class LoggingFormatterTest < Minitest::Test
|
37
37
|
def test_success_response
|
@@ -50,12 +50,14 @@ class LoggingFormatterTest < Minitest::Test
|
|
50
50
|
log_it(status: 401) do |loog|
|
51
51
|
str = loog.to_s
|
52
52
|
refute_empty(str)
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
53
|
+
[
|
54
|
+
%r{http://example.com},
|
55
|
+
/Authorization:/,
|
56
|
+
%r{HTTP/1.1 401},
|
57
|
+
/x-github-api-version-selected: "2022-11-28"/,
|
58
|
+
/hello, world!/,
|
59
|
+
/request body/
|
60
|
+
].each { |ptn| assert_match(ptn, str) }
|
59
61
|
end
|
60
62
|
end
|
61
63
|
|
data/test/fbe/test_award.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2024 Zerocracy
|
5
|
+
# Copyright (c) 2024-2025 Zerocracy
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"), to deal
|
@@ -63,8 +63,8 @@ class TestAward < Minitest::Test
|
|
63
63
|
judge: '', global: {}, loog: Loog::NULL, options: nil
|
64
64
|
)
|
65
65
|
b = a.bill(hours: 10)
|
66
|
-
|
67
|
-
|
66
|
+
assert_operator(b.points, :<=, 100)
|
67
|
+
assert_operator(b.points, :>=, 5)
|
68
68
|
assert_equal(40, b.points)
|
69
69
|
g = b.greeting
|
70
70
|
[
|
@@ -72,12 +72,12 @@ class TestAward < Minitest::Test
|
|
72
72
|
'+10 for resolving the bug in 10',
|
73
73
|
'bug in 10 (<36) hours',
|
74
74
|
'+30 as a basis'
|
75
|
-
].each { |t|
|
75
|
+
].each { |t| assert_includes(g, t, g) }
|
76
76
|
md = a.bylaw.markdown
|
77
77
|
[
|
78
78
|
'First, assume that _hours_ is hours',
|
79
79
|
', and award _b₂_'
|
80
|
-
].each { |t|
|
80
|
+
].each { |t| assert_includes(md, t, md) }
|
81
81
|
end
|
82
82
|
|
83
83
|
def test_some_terms
|
@@ -130,7 +130,7 @@ class TestAward < Minitest::Test
|
|
130
130
|
'Just add **17** when necessary'
|
131
131
|
}.each do |q, t|
|
132
132
|
md = Fbe::Award.new(q).bylaw.markdown
|
133
|
-
|
133
|
+
assert_includes(md, t, md)
|
134
134
|
end
|
135
135
|
end
|
136
136
|
|
data/test/fbe/test_bylaws.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2024 Zerocracy
|
5
|
+
# Copyright (c) 2024-2025 Zerocracy
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"), to deal
|
@@ -35,8 +35,8 @@ require_relative '../../lib/fbe/bylaws'
|
|
35
35
|
class TestBylaws < Minitest::Test
|
36
36
|
def test_simple
|
37
37
|
laws = Fbe.bylaws
|
38
|
-
|
39
|
-
|
38
|
+
assert_operator(laws.size, :>, 1)
|
39
|
+
refute_nil(laws['published-release-was-rewarded'])
|
40
40
|
end
|
41
41
|
|
42
42
|
def test_check_all_bills
|
@@ -102,10 +102,10 @@ class TestBylaws < Minitest::Test
|
|
102
102
|
}
|
103
103
|
awards.each do |title, pairs|
|
104
104
|
formula = Fbe.bylaws[title]
|
105
|
-
|
105
|
+
refute_nil(formula, title)
|
106
106
|
a = Fbe::Award.new(formula)
|
107
107
|
help = [
|
108
|
-
" '#{title.
|
108
|
+
" '#{title.tr('_', '-')}' => {\n ",
|
109
109
|
pairs.map do |args, _|
|
110
110
|
[
|
111
111
|
'{',
|
data/test/fbe/test_conclude.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2024 Zerocracy
|
5
|
+
# Copyright (c) 2024-2025 Zerocracy
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"), to deal
|
@@ -33,7 +33,7 @@ require_relative '../../lib/fbe/fb'
|
|
33
33
|
|
34
34
|
# Test.
|
35
35
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
36
|
-
# Copyright:: Copyright (c) 2024 Zerocracy
|
36
|
+
# Copyright:: Copyright (c) 2024-2025 Zerocracy
|
37
37
|
# License:: MIT
|
38
38
|
class TestConclude < Minitest::Test
|
39
39
|
def test_with_defaults
|
data/test/fbe/test_copy.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2024 Zerocracy
|
5
|
+
# Copyright (c) 2024-2025 Zerocracy
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"), to deal
|
@@ -29,7 +29,7 @@ require_relative '../../lib/fbe/copy'
|
|
29
29
|
|
30
30
|
# Test.
|
31
31
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
32
|
-
# Copyright:: Copyright (c) 2024 Zerocracy
|
32
|
+
# Copyright:: Copyright (c) 2024-2025 Zerocracy
|
33
33
|
# License:: MIT
|
34
34
|
class TestCopy < Minitest::Test
|
35
35
|
def test_simple_copy
|
@@ -52,6 +52,6 @@ class TestCopy < Minitest::Test
|
|
52
52
|
f2 = fb.insert
|
53
53
|
f2._id = 2
|
54
54
|
Fbe.copy(f1, f2, except: ['foo'])
|
55
|
-
|
55
|
+
assert_nil(f2['foo'])
|
56
56
|
end
|
57
57
|
end
|
data/test/fbe/test_enter.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2024 Zerocracy
|
5
|
+
# Copyright (c) 2024-2025 Zerocracy
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"), to deal
|
@@ -29,7 +29,7 @@ require_relative '../../lib/fbe/enter'
|
|
29
29
|
|
30
30
|
# Test.
|
31
31
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
32
|
-
# Copyright:: Copyright (c) 2024 Zerocracy
|
32
|
+
# Copyright:: Copyright (c) 2024-2025 Zerocracy
|
33
33
|
# License:: MIT
|
34
34
|
class TestEnter < Minitest::Test
|
35
35
|
def test_simple
|
data/test/fbe/test_fb.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2024 Zerocracy
|
5
|
+
# Copyright (c) 2024-2025 Zerocracy
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"), to deal
|
@@ -32,7 +32,7 @@ require_relative '../../lib/fbe/fb'
|
|
32
32
|
|
33
33
|
# Test.
|
34
34
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
35
|
-
# Copyright:: Copyright (c) 2024 Zerocracy
|
35
|
+
# Copyright:: Copyright (c) 2024-2025 Zerocracy
|
36
36
|
# License:: MIT
|
37
37
|
class TestFb < Minitest::Test
|
38
38
|
def test_simple
|
@@ -44,7 +44,7 @@ class TestFb < Minitest::Test
|
|
44
44
|
Fbe.fb.insert.bar = 2
|
45
45
|
assert_equal(1, Fbe.fb.query('(exists bar)').each.to_a.size)
|
46
46
|
stdout = $loog.to_s
|
47
|
-
|
47
|
+
assert_includes(stdout, 'Inserted new fact #1', stdout)
|
48
48
|
end
|
49
49
|
|
50
50
|
def test_increment_id_in_transaction
|
@@ -68,9 +68,9 @@ class TestFb < Minitest::Test
|
|
68
68
|
$loog = Loog::Buffer.new
|
69
69
|
Fbe.fb.insert
|
70
70
|
f = Fbe.fb.query('(always)').each.to_a.first
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
71
|
+
refute_nil(f._id)
|
72
|
+
refute_nil(f._time)
|
73
|
+
refute_nil(f._version)
|
74
|
+
refute_nil(f._job)
|
75
75
|
end
|
76
76
|
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2024 Zerocracy
|
5
|
+
# Copyright (c) 2024-2025 Zerocracy
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"), to deal
|
@@ -30,7 +30,7 @@ require_relative '../../lib/fbe/github_graph'
|
|
30
30
|
|
31
31
|
# Test.
|
32
32
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
33
|
-
# Copyright:: Copyright (c) 2024 Zerocracy
|
33
|
+
# Copyright:: Copyright (c) 2024-2025 Zerocracy
|
34
34
|
# License:: MIT
|
35
35
|
class TestGitHubGraph < Minitest::Test
|
36
36
|
def test_simple_use
|
@@ -41,7 +41,7 @@ class TestGitHubGraph < Minitest::Test
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def test_simple_use_graph
|
44
|
-
skip
|
44
|
+
skip("it's a live test, run it manually if you need it")
|
45
45
|
WebMock.allow_net_connect!
|
46
46
|
client = Fbe::Graph.new(token: ENV.fetch('GITHUB_TOKEN', nil))
|
47
47
|
result = client.query(
|
@@ -53,7 +53,7 @@ class TestGitHubGraph < Minitest::Test
|
|
53
53
|
}
|
54
54
|
GRAPHQL
|
55
55
|
)
|
56
|
-
|
56
|
+
refute_empty(result.viewer.login)
|
57
57
|
end
|
58
58
|
|
59
59
|
def test_use_with_global_variables
|
@@ -65,15 +65,15 @@ class TestGitHubGraph < Minitest::Test
|
|
65
65
|
end
|
66
66
|
|
67
67
|
def test_with_broken_token
|
68
|
-
skip
|
68
|
+
skip("it's a live test, run it manually if you need it")
|
69
69
|
WebMock.allow_net_connect!
|
70
70
|
global = {}
|
71
71
|
options = Judges::Options.new({ 'github_token' => 'incorrect-value' })
|
72
|
-
assert_raises { Fbe.github_graph(loog: Loog::NULL, global:, options:) }
|
72
|
+
assert_raises(StandardError) { Fbe.github_graph(loog: Loog::NULL, global:, options:) }
|
73
73
|
end
|
74
74
|
|
75
75
|
def test_gets_resolved_conversations
|
76
|
-
skip
|
76
|
+
skip("it's a live test, run it manually if you need it")
|
77
77
|
WebMock.allow_net_connect!
|
78
78
|
global = {}
|
79
79
|
options = Judges::Options.new
|
@@ -81,18 +81,18 @@ class TestGitHubGraph < Minitest::Test
|
|
81
81
|
result = g.resolved_conversations('zerocracy', 'baza', 172)
|
82
82
|
assert_equal(1, result.count)
|
83
83
|
result = g.resolved_conversations('zerocracy', 'baza', 0)
|
84
|
-
|
85
|
-
|
84
|
+
assert_instance_of(Array, result)
|
85
|
+
assert_equal(0, result.count)
|
86
86
|
result = g.resolved_conversations('zerocracy1', 'baza', 0)
|
87
|
-
|
88
|
-
|
87
|
+
assert_instance_of(Array, result)
|
88
|
+
assert_equal(0, result.count)
|
89
89
|
result = g.resolved_conversations('zerocracy', 'baza1', 0)
|
90
|
-
|
91
|
-
|
90
|
+
assert_instance_of(Array, result)
|
91
|
+
assert_equal(0, result.count)
|
92
92
|
end
|
93
93
|
|
94
94
|
def test_does_not_count_unresolved_conversations
|
95
|
-
skip
|
95
|
+
skip("it's a live test, run it manually if you need it")
|
96
96
|
WebMock.allow_net_connect!
|
97
97
|
g = Fbe.github_graph(options: Judges::Options.new, loog: Loog::NULL, global: {})
|
98
98
|
result = g.resolved_conversations('zerocracy', 'judges-action', 296)
|
@@ -100,20 +100,20 @@ class TestGitHubGraph < Minitest::Test
|
|
100
100
|
end
|
101
101
|
|
102
102
|
def test_gets_total_commits_of_repo
|
103
|
-
skip
|
103
|
+
skip("it's a live test, run it manually if you need it")
|
104
104
|
WebMock.allow_net_connect!
|
105
105
|
global = {}
|
106
106
|
options = Judges::Options.new
|
107
107
|
g = Fbe.github_graph(options:, loog: Loog::NULL, global:)
|
108
108
|
result = g.total_commits('zerocracy', 'baza', 'master')
|
109
|
-
|
109
|
+
assert_predicate(result, :positive?)
|
110
110
|
end
|
111
111
|
|
112
112
|
def test_get_fake_empty_conversations
|
113
113
|
WebMock.disable_net_connect!
|
114
114
|
graph = Fbe.github_graph(options: Judges::Options.new('testing' => true), loog: Loog::NULL, global: {})
|
115
115
|
result = graph.resolved_conversations(nil, 'baza', 172)
|
116
|
-
|
116
|
+
assert_empty(result)
|
117
117
|
end
|
118
118
|
|
119
119
|
def test_get_fake_conversations
|
data/test/fbe/test_if_absent.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2024 Zerocracy
|
5
|
+
# Copyright (c) 2024-2025 Zerocracy
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"), to deal
|
@@ -32,7 +32,7 @@ require_relative '../../lib/fbe/if_absent'
|
|
32
32
|
|
33
33
|
# Test.
|
34
34
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
35
|
-
# Copyright:: Copyright (c) 2024 Zerocracy
|
35
|
+
# Copyright:: Copyright (c) 2024-2025 Zerocracy
|
36
36
|
# License:: MIT
|
37
37
|
class TestIfAbsent < Minitest::Test
|
38
38
|
def test_ignores
|
@@ -42,7 +42,7 @@ class TestIfAbsent < Minitest::Test
|
|
42
42
|
Fbe.if_absent(fb:) do |f|
|
43
43
|
f.foo = 'hello dude'
|
44
44
|
end
|
45
|
-
|
45
|
+
assert_nil(n)
|
46
46
|
end
|
47
47
|
|
48
48
|
def test_ignores_with_time
|
@@ -53,7 +53,7 @@ class TestIfAbsent < Minitest::Test
|
|
53
53
|
Fbe.if_absent(fb:) do |f|
|
54
54
|
f.foo = t
|
55
55
|
end
|
56
|
-
|
56
|
+
assert_nil(n)
|
57
57
|
end
|
58
58
|
|
59
59
|
def test_injects
|
@@ -87,7 +87,7 @@ class TestIfAbsent < Minitest::Test
|
|
87
87
|
f.z = t
|
88
88
|
f.bar = 3.14
|
89
89
|
end
|
90
|
-
|
90
|
+
assert_nil(n)
|
91
91
|
end
|
92
92
|
|
93
93
|
def test_complex_injects
|
@@ -105,6 +105,6 @@ class TestIfAbsent < Minitest::Test
|
|
105
105
|
f.z = t + 1
|
106
106
|
f.bar = 3.15
|
107
107
|
end
|
108
|
-
|
108
|
+
refute_nil(n)
|
109
109
|
end
|
110
110
|
end
|
data/test/fbe/test_issue.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2024 Zerocracy
|
5
|
+
# Copyright (c) 2024-2025 Zerocracy
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"), to deal
|
@@ -29,7 +29,7 @@ require_relative '../../lib/fbe/issue'
|
|
29
29
|
|
30
30
|
# Test.
|
31
31
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
32
|
-
# Copyright:: Copyright (c) 2024 Zerocracy
|
32
|
+
# Copyright:: Copyright (c) 2024-2025 Zerocracy
|
33
33
|
# License:: MIT
|
34
34
|
class TestIssue < Minitest::Test
|
35
35
|
def test_simple
|
data/test/fbe/test_iterate.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2024 Zerocracy
|
5
|
+
# Copyright (c) 2024-2025 Zerocracy
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"), to deal
|
@@ -31,7 +31,7 @@ require_relative '../../lib/fbe/iterate'
|
|
31
31
|
|
32
32
|
# Test.
|
33
33
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
34
|
-
# Copyright:: Copyright (c) 2024 Zerocracy
|
34
|
+
# Copyright:: Copyright (c) 2024-2025 Zerocracy
|
35
35
|
# License:: MIT
|
36
36
|
class TestIterate < Minitest::Test
|
37
37
|
def test_simple
|
data/test/fbe/test_just_one.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2024 Zerocracy
|
5
|
+
# Copyright (c) 2024-2025 Zerocracy
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"), to deal
|
@@ -29,7 +29,7 @@ require_relative '../../lib/fbe/just_one'
|
|
29
29
|
|
30
30
|
# Test.
|
31
31
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
32
|
-
# Copyright:: Copyright (c) 2024 Zerocracy
|
32
|
+
# Copyright:: Copyright (c) 2024-2025 Zerocracy
|
33
33
|
# License:: MIT
|
34
34
|
class TestJustOne < Minitest::Test
|
35
35
|
def test_ignores
|
@@ -39,7 +39,7 @@ class TestJustOne < Minitest::Test
|
|
39
39
|
Fbe.just_one(fb:) do |f|
|
40
40
|
f.foo = 'hello dude'
|
41
41
|
end
|
42
|
-
|
42
|
+
refute_nil(n)
|
43
43
|
end
|
44
44
|
|
45
45
|
def test_injects
|