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
9d889f50
Commit
9d889f50
authored
Jan 13, 2015
by
Bruno Pinto
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #310 from bucaran/stop-test-continue-suite
parents
5f92c044
125f8d43
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
9 deletions
+15
-9
oh-my-fish.fish
oh-my-fish.fish
+1
-0
plugins/fish-spec/expect.fish
plugins/fish-spec/expect.fish
+6
-0
plugins/fish-spec/spec.eval.fish
plugins/fish-spec/spec.eval.fish
+3
-1
plugins/fish-spec/spec.run.fish
plugins/fish-spec/spec.run.fish
+4
-7
spec/oh-my-fish.spec.fish
spec/oh-my-fish.spec.fish
+1
-1
No files found.
oh-my-fish.fish
View file @
9d889f50
...
@@ -15,6 +15,7 @@ if not contains $fish_path/functions/ $fish_function_path
...
@@ -15,6 +15,7 @@ if not contains $fish_path/functions/ $fish_function_path
set fish_function_path $fish_path/functions/ $fish_function_path
set fish_function_path $fish_path/functions/ $fish_function_path
end
end
# Add imported plugins, completions and themes. Customize imported
# Add imported plugins, completions and themes. Customize imported
# commands via the $fish_path/custom directory, for example create
# commands via the $fish_path/custom directory, for example create
# a directory under $fish_path/custom/themes with the same name as
# a directory under $fish_path/custom/themes with the same name as
...
...
plugins/fish-spec/expect.fish
View file @
9d889f50
...
@@ -21,6 +21,12 @@
...
@@ -21,6 +21,12 @@
# spec.run
# spec.run
#/
#/
function expect
function expect
# Abort if last call to `expect` finished with $status 1. This allows to
# stop individual tests from running if at least one expect call fails.
if [ $status -eq 1 ]
return 1
end
set -l expected $argv[1..-3]
set -l expected $argv[1..-3]
set -l condition $argv[-2]
set -l condition $argv[-2]
set -l actual $argv[-1]
set -l actual $argv[-1]
...
...
plugins/fish-spec/spec.eval.fish
View file @
9d889f50
...
@@ -81,6 +81,7 @@ function spec.eval -d "Eval a function by name and echo its description field."
...
@@ -81,6 +81,7 @@ function spec.eval -d "Eval a function by name and echo its description field."
end
end
end
end
set -l result 0
for test in $tests
for test in $tests
if [ -z "$silent" ]
if [ -z "$silent" ]
set -l info (spec.get.info $tests)
set -l info (spec.get.info $tests)
...
@@ -91,6 +92,7 @@ function spec.eval -d "Eval a function by name and echo its description field."
...
@@ -91,6 +92,7 @@ function spec.eval -d "Eval a function by name and echo its description field."
spec.log --message $default_color "$info"
spec.log --message $default_color "$info"
end
end
eval $test
eval $test
or
return
1
or
set result
1
end
end
return $result
end
end
plugins/fish-spec/spec.run.fish
View file @
9d889f50
...
@@ -47,17 +47,14 @@ function spec.run
...
@@ -47,17 +47,14 @@ function spec.run
spec.eval before_all $output
spec.eval before_all $output
for test in (spec.functions "it_")
for test in (spec.functions "it_")
spec.eval before_each $output
spec.eval before_each $output
# Stop test execution if an expectation fails.
# Flunk test if any single test fails, but do not stop the suite.
if not spec.eval $test --unit --depth 1 $output
if not spec.eval $test --unit --depth 1 $output
set result 1
# Flunk
set result 1
end
end
# Make sure to run after_each
if
test fails.
# Make sure to run after_each
even if a
test fails.
spec.eval after_each $output
spec.eval after_each $output
if [ $result -eq 1 ]
# We can safely exit the loop if test fails.
break
end
end
end
spec.eval after_all $output
spec.eval after_all $output
...
...
spec/oh-my-fish.spec.fish
View file @
9d889f50
...
@@ -57,7 +57,7 @@ function describe_oh_my_fish -d "Oh-My-Fish test spec..."
...
@@ -57,7 +57,7 @@ function describe_oh_my_fish -d "Oh-My-Fish test spec..."
set -g fish_plugins bak z
set -g fish_plugins bak z
load_oh_my_fish
load_oh_my_fish
expect $fish_function_path --to-contain $fish_path/plugins/bak
expect $fish_function_path --to-contain $fish_path/plugins/bak
and
expect $fish_function_path --to-contain $fish_path/plugins/z
expect $fish_function_path --to-contain $fish_path/plugins/z
end
end
function it_loads_the_selected_theme \
function it_loads_the_selected_theme \
...
...
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