fbe 0.16.0 → 0.16.1
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/lib/fbe/octo.rb +34 -11
- data/lib/fbe.rb +1 -1
- data/test/fbe/test_octo.rb +29 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 011c5a07ab2d1b15194cd2950da1cd466698d37a9aa0bbd07225ce7bca335881
|
4
|
+
data.tar.gz: 1fa420cebbdc70897a4779601a5cc8e4596a9542a223e64e020086ff0ec10826
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1790fa88d1d97b8509d61c85592c36ca5147e97e982015991fc15128315a210190505310cf1d53b618507b354e1b77b065bbc1cbfff4b8ffc771f50bea5778fa
|
7
|
+
data.tar.gz: 4bf95961acba3192c824e48054c8a36d7aa72184645305c8fcc6ef9e5926cd08c7f661353bc6244b8e789b1fb5ea2e4dcf8a089969267bc55b80fdf9b641b775
|
data/lib/fbe/octo.rb
CHANGED
@@ -570,17 +570,40 @@ class Fbe::FakeOctokit
|
|
570
570
|
# client.issue('octocat/Hello-World', 42)
|
571
571
|
# # => {:id=>42, :number=>42, :created_at=>...}
|
572
572
|
def issue(repo, number)
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
full_name: repo
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
573
|
+
if number == 142
|
574
|
+
{
|
575
|
+
id: 655,
|
576
|
+
number:,
|
577
|
+
repo: { full_name: repo },
|
578
|
+
user: { login: 'yegor256', id: 526_301, type: 'User' },
|
579
|
+
created_at: Time.parse('2025-06-01 12:00:55 UTC'),
|
580
|
+
updated_at: Time.parse('2025-06-01 15:47:18 UTC'),
|
581
|
+
closed_at: Time.parse('2025-06-02 15:00:00 UTC')
|
582
|
+
}
|
583
|
+
elsif number == 143
|
584
|
+
{
|
585
|
+
id: 656,
|
586
|
+
number:,
|
587
|
+
repo: { full_name: repo },
|
588
|
+
user: { login: 'yegor256', id: 526_301, type: 'User' },
|
589
|
+
pull_request: { merged_at: nil },
|
590
|
+
created_at: Time.parse('2025-05-29 17:00:55 UTC'),
|
591
|
+
updated_at: Time.parse('2025-05-29 19:00:00 UTC'),
|
592
|
+
closed_at: Time.parse('2025-06-01 18:20:00 UTC')
|
593
|
+
}
|
594
|
+
else
|
595
|
+
{
|
596
|
+
id: 42,
|
597
|
+
number:,
|
598
|
+
repo: {
|
599
|
+
full_name: repo
|
600
|
+
},
|
601
|
+
pull_request: {
|
602
|
+
merged_at: nil
|
603
|
+
},
|
604
|
+
created_at: Time.parse('2024-09-20 19:00:00 UTC')
|
605
|
+
}
|
606
|
+
end
|
584
607
|
end
|
585
608
|
|
586
609
|
# Gets a single pull request.
|
data/lib/fbe.rb
CHANGED
data/test/fbe/test_octo.rb
CHANGED
@@ -293,4 +293,33 @@ class TestOcto < Fbe::Test
|
|
293
293
|
}
|
294
294
|
end
|
295
295
|
end
|
296
|
+
|
297
|
+
def test_fetch_fake_issue_and_pr
|
298
|
+
o = Fbe.octo(loog: Loog::NULL, global: {}, options: Judges::Options.new({ 'testing' => true }))
|
299
|
+
result = o.issue('yegor256/test', 142)
|
300
|
+
assert_equal(Time.parse('2025-06-02 15:00:00 UTC'), result[:closed_at])
|
301
|
+
assert_pattern do
|
302
|
+
result => {
|
303
|
+
id: 655,
|
304
|
+
number: 142,
|
305
|
+
user: { login: 'yegor256', id: 526_301, type: 'User' },
|
306
|
+
created_at: Time,
|
307
|
+
updated_at: Time,
|
308
|
+
closed_at: Time
|
309
|
+
}
|
310
|
+
end
|
311
|
+
result = o.issue('yegor256/test', 143)
|
312
|
+
assert_equal(Time.parse('2025-06-01 18:20:00 UTC'), result[:closed_at])
|
313
|
+
assert_pattern do
|
314
|
+
result => {
|
315
|
+
id: 656,
|
316
|
+
number: 143,
|
317
|
+
user: { login: 'yegor256', id: 526_301, type: 'User' },
|
318
|
+
pull_request: { merged_at: nil },
|
319
|
+
created_at: Time,
|
320
|
+
updated_at: Time,
|
321
|
+
closed_at: Time
|
322
|
+
}
|
323
|
+
end
|
324
|
+
end
|
296
325
|
end
|