Skip to content
This repository has been archived by the owner on Feb 3, 2021. It is now read-only.

Add section tests for node #51

Merged
merged 9 commits into from
Jul 26, 2018
Merged

Add section tests for node #51

merged 9 commits into from
Jul 26, 2018

Conversation

matchai
Copy link
Owner

@matchai matchai commented Jul 25, 2018

Description

  • Write tests for the node section
  • Add mock.fish to allow for the mocking of utilities

Motivation and Context

Increases our test coverage!

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Improve test coverage

How Has This Been Tested?

  • I have tested using MacOS
  • I have tested using Linux

Checklist:

  • I have checked that no other PR duplicates mine
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have updated the tests accordingly.

@matchai matchai changed the title Add section tests for node and battery Add section tests for node Jul 25, 2018
@@ -13,7 +13,7 @@ function __sf_section_node -d "Display the local node version"
__sf_util_set_default SPACEFISH_NODE_PREFIX $SPACEFISH_PROMPT_DEFAULT_PREFIX
__sf_util_set_default SPACEFISH_NODE_SUFFIX $SPACEFISH_PROMPT_DEFAULT_SUFFIX
__sf_util_set_default SPACEFISH_NODE_SYMBOL "⬢ "
__sf_util_set_default SPACEFISH_NODE_DEFAULT_VERSION $SPACEFISH_NODE_DEFAULT_VERSION
__sf_util_set_default SPACEFISH_NODE_DEFAULT_VERSION ""
Copy link
Owner Author

@matchai matchai Jul 25, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should default to empty string. Not sure why it was defaulting to itself before. 😅

@@ -73,7 +73,7 @@ function __sf_section_battery -d "Displays battery symbol and charge"
end

# Remove trailing % and symbols for comparison
set battery_percent (echo $battery_percent | tr -d "%[,;]")
set battery_percent (echo $battery_percent | string trim --chars=%[,;])
Copy link
Owner Author

@matchai matchai Jul 25, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use fish string manipulation utils to ensure compatibility with Unix emulators that may not have tr. 🐟

@matchai matchai requested a review from tiffafoo July 25, 2018 21:43
@matchai matchai mentioned this pull request Jul 26, 2018
12 tasks
@matchai matchai merged commit e434118 into master Jul 26, 2018
@matchai matchai deleted the section-tests branch July 26, 2018 02:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant