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
68b8546c
Commit
68b8546c
authored
Jan 14, 2015
by
Bruno Pinto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
expect --to-not-contain tests and fix
parent
ee23d589
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
2 deletions
+67
-2
plugins/fish-spec/expect.fish
plugins/fish-spec/expect.fish
+2
-2
plugins/fish-spec/spec/expect.to_not_contain.spec.fish
plugins/fish-spec/spec/expect.to_not_contain.spec.fish
+65
-0
No files found.
plugins/fish-spec/expect.fish
View file @
68b8546c
...
...
@@ -61,10 +61,10 @@ function expect
case --to-not-contain
set result 0
for item in $actual
not
contains -- "$item" $expected
contains -- "$item" $expected
or set result $status
end
test $result -
eq
0
test $result -
ne
0
case --to-eq\*
test "$expected" = "$actual"
end
...
...
plugins/fish-spec/spec/expect.to_not_contain.spec.fish
0 → 100644
View file @
68b8546c
import plugins/fish-spec
function describe_to_not_contain -d 'expect --to-not-contain'
function before_each
set -e result
end
function it_returns_1_when_arrays_are_the_same
set -l array 1 2
echo (expect $array --to-not-contain $array; set result $status) >/dev/null
expect $result --to-equal 1
end
function it_returns_0_when_arrays_are_different
set -l array 1 2
echo (expect $array --to-not-contain 8 9; set result $status) >/dev/null
expect $result --to-equal 0
end
function it_returns_1_when_arrays_have_the_same_elements_but_in_different_order
set -l array 1 2
echo (expect $array --to-not-contain 2 1; set result $status) >/dev/null
expect $result --to-equal 1
end
function it_returns_1_when_expected_array_contains_the_element
set -l array 1 2
echo (expect $array --to-not-contain 1; set result $status) >/dev/null
expect $result --to-equal 1
end
function it_returns_0_when_expected_array_does_not_contain_the_element
set -l array 1 2
echo (expect $array --to-not-contain 9; set result $status) >/dev/null
expect $result --to-equal 0
end
function it_returns_1_when_expected_array_contains_all_elements
set -l array 1 2 3
echo (expect $array --to-not-contain 1 2; set result $status) >/dev/null
expect $result --to-equal 1
end
function it_returns_0_when_expected_array_does_not_contain_all_elements
set -l array 1 2 3
echo (expect $array --to-not-contain 1 2 9; set result $status) >/dev/null
expect $result --to-equal 0
end
function it_returns_0_when_expected_array_contains_less_elements
set -l array 1 2
echo (expect $array --to-not-contain 1 2 9; set result $status)
expect $result --to-equal 0
end
end
spec.run $argv
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