mirror of
https://github.com/RGBCube/nu_scripts
synced 2025-08-01 22:57:46 +00:00

This PR is part of porting all old scripts #221 and includes a set of modules: - `config_management` - `language` - `tests` - `prompt` ## 12 files changed ### `config_management` This module was removed, because it was related to the old `config.toml` format 1. `README.md`: removed 2. `config.toml`: removed 3. `startup.nu`: removed ### `language` 4. `playground.nu` : unchanged because this is just `source ...` 5. `std.nu` : unchanged because this is just `source ...` 6. `playground/lib.nu` -> `playground/mod.nu` and all commands have been exported 7. `std/date.nu` + `export` keyword ### `tests` This module contained only the usage of `language` module, so I merged it with `language` 8. `tests/language/std/date.nu` -> `modules/language/tests/date.nu` 9. `main.nu`: removed because it was just `source date.nu` ### `prompt` 10. `git_status_prompt.nu` -> `modules/git_status_prompt.nu` + `export` keyword 11. `left_and_right_prompt.nu` -> `modules/left_and_right_prompt.nu` + `export` keyword 12. `README.md` : has been removed as a duplicate of `modules/prompt/README.md`
34 lines
640 B
Text
34 lines
640 B
Text
use ../playground *
|
|
use ../std/date.nu *
|
|
|
|
def mock-now [] {
|
|
"2021-08-29 03:31:21" | into datetime
|
|
}
|
|
|
|
def people [] {
|
|
[
|
|
[ 'name', 'tz'];
|
|
[ 'andres', 'America/Guayaquil']
|
|
[ 'fdncred', 'US/Central']
|
|
]
|
|
}
|
|
|
|
playground "std/date" {
|
|
|
|
scene 'command: "date local"' {
|
|
|
|
play "adds times in local timezone" {|topic|
|
|
|
|
let expected_times = [
|
|
"Sun Aug 29 03:31:21 2021"
|
|
"Sun Aug 29 03:31:21 2021"
|
|
] | into datetime;
|
|
let actual = (people | date local (mock-now) | get time | into datetime)
|
|
|
|
expect $topic $actual --to-be $expected_times
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|