OLD | NEW |
(Empty) | |
| 1 #!/bin/bash |
| 2 |
| 3 ## Include utility functions. |
| 4 . "$XDG_TEST_DIR/include/testassertions.sh" |
| 5 |
| 6 . "$XDG_TEST_DIR/include/testcontrol.sh" |
| 7 |
| 8 ## Test function |
| 9 test_plain_file_install() { |
| 10 ## Begin the test. |
| 11 test_start "$FUNCNAME: verify text file is installed correctly on the desktop" |
| 12 |
| 13 # Dependencies section |
| 14 test_init |
| 15 |
| 16 INSFILE="xdgtestdata-$XDG_TEST_SHORTID.txt" |
| 17 set_no_display |
| 18 echo "Some more boring text. $XDG_TEST_ID" > "$INSFILE" |
| 19 assert_file "$INSFILE" |
| 20 |
| 21 DESKTOP="$HOME/Desktop" |
| 22 |
| 23 # Verify the test icon is not installed already. |
| 24 assert_file_not_in_path "$INSFILE" "$DESKTOP" |
| 25 |
| 26 # Test steps section |
| 27 test_procedure |
| 28 |
| 29 assert_exit 0 xdg-desktop-icon install "$INSFILE" |
| 30 assert_nostdout |
| 31 assert_nostderr |
| 32 |
| 33 assert_file_in_path "$INSFILE" "$DESKTOP" |
| 34 |
| 35 assert_interactive_notroot "Is there an icon on the desktop with name '$INSFILE'
?" y |
| 36 |
| 37 ## Cleanup |
| 38 xdg-desktop-icon uninstall "$INSFILE" |
| 39 |
| 40 test_result |
| 41 } |
| 42 |
| 43 run_test test_plain_file_install |
OLD | NEW |