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
3d1a90e2
Commit
3d1a90e2
authored
Dec 19, 2015
by
Bruno Pinto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Split formatter from test runner
parent
0b66c436
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
45 deletions
+48
-45
pkg/fish-spec/basic_formatter.fish
pkg/fish-spec/basic_formatter.fish
+44
-0
pkg/fish-spec/functions/fish-spec.fish
pkg/fish-spec/functions/fish-spec.fish
+4
-45
No files found.
pkg/fish-spec/basic_formatter.fish
0 → 100644
View file @
3d1a90e2
function __fish-spec.spec_init -e spec_init -a spec
set -e __current_spec_status
end
function __fish-spec.spec_finished -e spec_finished -a spec
functions -e $spec
switch "$__current_spec_status"
case success
emit spec_success
case error
emit spec_error
case '*'
emit spec_no_assertions
end
end
function __fish-spec.spec_success -e spec_success
echo -n '.'
end
function __fish-spec.spec_error -e spec_error
echo -n 'F'
set -g __any_spec_failed true
end
function __fish-spec.spec_no_assertions -e spec_no_assertions
echo -n 'N/A'
end
function __fish-spec_assertion_success -e assertion_success
set -q __current_spec_status; or set -g __current_spec_status success
end
function __fish-spec_assertion_error -e assertion_error -a error_message
# Mimics output redirect inside an event handler
if set -q __fish_spec_output
set __fish_spec_output $error_message
else
echo $error_message
end
set -g __current_spec_status error
end
pkg/fish-spec/functions/fish-spec.fish
View file @
3d1a90e2
function fish-spec
# Source formatter
set -l fish_spec_dir (dirname (dirname (status -f)))
source $fish_spec_dir/basic_formatter.fish
# Reset internal variables
set -e __any_spec_failed
...
...
@@ -46,48 +50,3 @@ function __fish-spec.run_suite -a suite_name
functions -e before_all before_each after_each after_all
end
function __fish-spec.spec_init -e spec_init -a spec
set -e __current_spec_status
end
function __fish-spec.spec_finished -e spec_finished -a spec
functions -e $spec
switch "$__current_spec_status"
case success
emit spec_success
case error
emit spec_error
case '*'
emit spec_no_assertions
end
end
function __fish-spec.spec_success -e spec_success
echo -n '.'
end
function __fish-spec.spec_error -e spec_error
echo -n 'F'
set -g __any_spec_failed true
end
function __fish-spec.spec_no_assertions -e spec_no_assertions
echo -n 'N/A'
end
function __fish-spec_assertion_success -e assertion_success
set -q __current_spec_status; or set -g __current_spec_status success
end
function __fish-spec_assertion_error -e assertion_error -a error_message
# Mimics output redirect inside an event handler
if set -q __fish_spec_output
set __fish_spec_output $error_message
else
echo $error_message
end
set -g __current_spec_status error
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