Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
O
oh-my-fish
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
oh-my-fish
Commits
8526252b
Commit
8526252b
authored
Dec 17, 2015
by
Bruno Pinto
Committed by
Derek Stavis
Jun 14, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tests for plugin install
Ref #201
parent
ab02f52d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
76 additions
and
7 deletions
+76
-7
pkg/fish-spec/functions/assert.expand_operator.fish
pkg/fish-spec/functions/assert.expand_operator.fish
+2
-0
pkg/omf/spec/basic_spec.fish
pkg/omf/spec/basic_spec.fish
+0
-7
pkg/omf/spec/plugin_install_spec.fish
pkg/omf/spec/plugin_install_spec.fish
+74
-0
No files found.
pkg/fish-spec/functions/assert.expand_operator.fish
View file @
8526252b
...
@@ -2,6 +2,8 @@ function assert.expand_operator -a operator
...
@@ -2,6 +2,8 @@ function assert.expand_operator -a operator
switch $operator
switch $operator
case =
case =
echo equals
echo equals
case -n
echo not empty
case \-z
case \-z
echo empty
echo empty
case \*
case \*
...
...
pkg/omf/spec/basic_spec.fish
View file @
8526252b
...
@@ -12,11 +12,4 @@ function describe_basic_tests
...
@@ -12,11 +12,4 @@ function describe_basic_tests
set -l output (omf doctor)
set -l output (omf doctor)
assert 0 = $status
assert 0 = $status
end
end
function it_install_packages
set -l remove_output (omf remove apt ^/dev/null)
set -l install_output (omf install apt)
assert 0 = $status
end
end
end
pkg/omf/spec/plugin_install_spec.fish
0 → 100644
View file @
8526252b
function describe_plugin_install
function before_all
set -gx CI WORKAROUND
end
function before_each
rm -rf $OMF_PATH/pkg/omf-test-plugin-* ^/dev/null
cp $OMF_CONFIG/bundle $OMF_CONFIG/bundle.fish-spec
end
function after_each
rm -rf $OMF_PATH/pkg/omf-test-plugin-* ^/dev/null
cp $OMF_CONFIG/bundle.fish-spec $OMF_CONFIG/bundle
end
function after_all
rm -rf $OMF_PATH/db/pkg/omf-test-plugin-*
end
function it_installs_plugins_from_the_bundle_file_when_called_with_no_arguments
echo package (plugin) > $OMF_CONFIG/bundle
set -l output (omf install 2>&1 | grep "omf-test-plugin-valid")
assert -n "$output"
end
function it_returns_success_if_a_plugin_is_installed
omf install (plugin) >/dev/null
assert 0 = $status
end
function it_prints_a_success_message_if_a_plugin_is_installed
set -l output (omf install (plugin) | grep "successfully installed")
assert -n "$output"
end
#function it_returns_an_error_if_a_plugin_fails_to_install
#omf install (invalid_plugin) >/dev/null 2>&1
#assert 1 = $status
#end
function it_prints_an_error_message_if_a_plugin_fails_to_install
set -l output (omf install (invalid_plugin) 2>&1 | grep "Could not install package")
assert -n "$output"
end
function it_returns_success_if_a_plugin_and_its_dependencies_are_installed
omf install (plugin_with_dependent_plugin) >/dev/null
assert 0 = $status
end
function it_prints_a_success_message_if_a_plugin_and_its_dependencies_are_installed
set -l count (omf install (plugin_with_dependent_plugin) | grep -o "successfully installed" | wc -l | bc)
assert 2 = $count
end
### Factories ###
function plugin
cp $OMF_PATH/db/pkg/basename-compat $OMF_PATH/db/pkg/omf-test-plugin-valid
echo 'omf-test-plugin-valid'
end
function invalid_plugin
echo 'omf-test-plugin-invalid'
end
function plugin_with_dependent_plugin
omf remove foreign-env 2>&1 >/dev/null #Temporary workaround until we have offline install
cp $OMF_PATH/db/pkg/nvm $OMF_PATH/db/pkg/omf-test-plugin-with-dependent
echo 'omf-test-plugin-with-dependent'
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment