-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Roberto Reale
committed
Mar 9, 2018
1 parent
f311093
commit f38dde4
Showing
5 changed files
with
48 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/usr/bin/env bats | ||
|
||
source bashlet time/date | ||
|
||
@test "time/date: get a random date" { | ||
result="$(bash$$ date get_random)" | ||
expected="[0-9]{4}-[0-9]{2}-[0-9]{2}" | ||
[[ $result =~ $expected ]] | ||
} |
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,15 @@ | ||
#!/usr/bin/env bats | ||
|
||
source bashlet time/elapsed | ||
|
||
@test "time/elapsed: format a number of seconds" { | ||
result="$(bash$$ elapsed seconds_to_formatted 86400)" | ||
expected="01:00:00:00" | ||
[[ $result == $expected ]] | ||
} | ||
|
||
@test "time/elapsed: describe a number of seconds" { | ||
result="$(bash$$ elapsed seconds_to_description 86400)" | ||
expected="1 day(s), 0 hour(s), 0 minute(s), 0 second(s)" | ||
[[ $result == $expected ]] | ||
} |
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,9 @@ | ||
#!/usr/bin/env bats | ||
|
||
source bashlet time/month | ||
|
||
@test "time/month: count days in month" { | ||
result="$(bash$$ month count_days 1)" | ||
expected=31 | ||
[[ $result -eq $expected ]] | ||
} |
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,8 @@ | ||
#!/usr/bin/env bats | ||
|
||
source bashlet time/year | ||
|
||
@test "time/year: is a given year a leap year?" { | ||
(bash$$ year is_leap 2000) | ||
[[ $status -eq 0 ]] | ||
} |