Skip to content

Commit

Permalink
Merge pull request #76 from shellspec/implement_successfull_matcher
Browse files Browse the repository at this point in the history
Add successful matcher
  • Loading branch information
ko1nksm committed Jun 9, 2020
2 parents f0b746c + 28dcb02 commit 3859c71
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/core/matchers/be.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ shellspec_import 'core/matchers/be/stat'
shellspec_import 'core/matchers/be/status'
shellspec_import 'core/matchers/be/valid'
shellspec_import 'core/matchers/be/variable'
shellspec_import 'core/matchers/be/successful'
3 changes: 3 additions & 0 deletions lib/core/matchers/be/successful.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#shellcheck shell=sh

shellspec_syntax_alias 'shellspec_matcher_be_successful' 'shellspec_matcher_be_defined'
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"lib/core/matchers/be/empty.sh",
"lib/core/matchers/be/stat.sh",
"lib/core/matchers/be/status.sh",
"lib/core/matchers/be/successful.sh",
"lib/core/matchers/be/valid.sh",
"lib/core/matchers/be/variable.sh",
"lib/core/matchers/end_with.sh",
Expand Down
3 changes: 3 additions & 0 deletions spec/core/modifiers/result_spec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@ Describe "core/modifiers/result.sh"

Describe "result modifier"
foo() { echo ok; true; }
bar() { false; }

Example 'example'
The result of 'foo()' should equal ok
The result of 'foo()' should be successful
The result of 'bar()' should not be successful
End

Describe 'example with stdout, stderr and status'
Expand Down

0 comments on commit 3859c71

Please sign in to comment.