-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: ๐ธ Prekin.next ใๅฎ่ฃ
ใใๆฌกใฎใใฌ้ใฎๅนดๆๆฅใๅๅพใงใใใใใซใใ (#182)
* feat: ๐ธ Prekin.next ใๅฎ่ฃ ใใๆฌกใฎใใฌ้ใฎๅนดๆๆฅใๅๅพใงใใใใใซใใ * docs: โ๏ธ README ใซ Prekin.next ใฎ่ชฌๆใ่ฟฝๅ ใใ
- Loading branch information
1 parent
de55f0f
commit 1ae4ed3
Showing
3 changed files
with
175 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
# 10ๆ 2020 | ||
# ๆฅ ๆ ็ซ ๆฐด ๆจ ้ ๅ | ||
# 1 2 3 | ||
# 4 5 6 7 8 9 10 | ||
# 11 12 13 14 15 16 17 | ||
# 18 19 20 21 22 23 24 | ||
# 25 26 27 28 29 30 31 | ||
# | ||
# 1ๆ 2020 | ||
# ๆฅ ๆ ็ซ ๆฐด ๆจ ้ ๅ | ||
# 1 2 3 4 | ||
# 5 6 7 8 9 10 11 | ||
# 12 13 14 15 16 17 18 | ||
# 19 20 21 22 23 24 25 | ||
# 26 27 28 29 30 31 | ||
|
||
# 10ๆ 2019 | ||
# ๆฅ ๆ ็ซ ๆฐด ๆจ ้ ๅ | ||
# 1 2 3 4 5 | ||
# 6 7 8 9 10 11 12 | ||
# 13 14 15 16 17 18 19 | ||
# 20 21 22 23 24 25 26 | ||
# 27 28 29 30 31 | ||
|
||
RSpec.describe Prekin do | ||
describe 'ใฏใฉในใกใฝใใ' do | ||
describe '#next' do | ||
xit '2023/09/05 ใซใใใ next ใฏ 2023/09/29 ใงใใใใจ๏ผๆฅๆๆๅฎใชใ๏ผ' do | ||
# TODO: travel_to ใ Timecop ใๅฟ ่ฆ | ||
next_day = Prekin.next | ||
|
||
expect(next_day).to eq '2023-09-29' | ||
end | ||
|
||
it '2023/09/05 ใซใใใ next ใฏ 2023/09/29 ใงใใใใจ๏ผๆฅๆๆๅฎใใ๏ผ' do | ||
next_day = Prekin.next('2023-09-05') | ||
|
||
expect(next_day).to eq '2023-09-29' | ||
end | ||
|
||
it '2023/09/30 ใซใใใ next ใฏ 2023/10/27 ใงใใใใจ๏ผๆฅๆๆๅฎใใ๏ผ' do | ||
next_day = Prekin.next('2023-09-30') | ||
|
||
expect(next_day).to eq '2023-10-27' | ||
end | ||
|
||
it '2023/12/28 ใซใใใ next ใฏ 2023/12/29 ใงใใใใจ๏ผๆฅๆๆๅฎใใ๏ผ' do | ||
next_day = Prekin.next('2023-12-28') | ||
|
||
expect(next_day).to eq '2023-12-29' | ||
end | ||
|
||
it '2023/12/30 ใซใใใ next ใฏ 2024/01/26 ใงใใใใจ๏ผๆฅๆๆๅฎใใ๏ผ' do | ||
next_day = Prekin.next('2023-12-30') | ||
|
||
expect(next_day).to eq '2024-01-26' | ||
end | ||
|
||
it '2022/12/24 ใซใใใ next ใฏ 2022/12/30 ใงใใใใจ๏ผๆฅๆๆๅฎใใ๏ผ' do | ||
next_day = Prekin.next('2022-12-24') | ||
|
||
expect(next_day).to eq '2022-12-30' | ||
end | ||
|
||
it '2022/12/30 ใซใใใ next ใฏ 2022/12/30 ใงใใใใจ๏ผๆฅๆๆๅฎใใ๏ผ' do | ||
next_day = Prekin.next('2022-12-30') | ||
|
||
expect(next_day).to eq '2022-12-30' | ||
end | ||
|
||
it '2022/12/31 ใซใใใ next ใฏ 2023/01/27 ใงใใใใจ๏ผๆฅๆๆๅฎใใ๏ผ' do | ||
next_day = Prekin.next('2022-12-31') | ||
|
||
expect(next_day).to eq '2023-01-27' | ||
end | ||
end | ||
|
||
describe '#previous' do | ||
xit '2023/09/05 ใซใใใ previous ใฏ 2023/08/25 ใงใใใใจ๏ผๆฅๆๆๅฎใชใ๏ผ' do | ||
# TODO: travel_to ใ Timecop ใๅฟ ่ฆ | ||
previous_day = Prekin.previous | ||
|
||
expect(previous_day).to eq '2023-08-25' | ||
end | ||
|
||
xit '2023/09/05 ใซใใใ previous ใฏ 2023/08/25 ใงใใใใจ๏ผๆฅๆๆๅฎใใ๏ผ' do | ||
previous_day = Prekin.previous('2023-09-05') | ||
|
||
expect(previous_day).to eq '2023-08-25' | ||
end | ||
end | ||
end | ||
end |