Skip to content

Commit

Permalink
Fixed typo in matcher name
Browse files Browse the repository at this point in the history
Closes #17
  • Loading branch information
ko1nksm committed Nov 10, 2019
1 parent 81fa64b commit 4551950
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion docs/references.md
Expand Up @@ -103,7 +103,7 @@ stat (the subject expect file path)
| be writable | The file should be a writable. |
| be executable | The file should be an executable. |
| be block_device | The file should be a block device. |
| be charactor_device | The file should be a charactor device. |
| be character_device | The file should be a character device. |
| has setgid | The file should has setgid. |
| has setuid | The file should has setuid. |

Expand Down
6 changes: 3 additions & 3 deletions lib/core/matchers/be/stat.sh
Expand Up @@ -14,8 +14,8 @@ shellspec_syntax 'shellspec_matcher_be_executable'

shellspec_syntax_compound 'shellspec_matcher_be_block'
shellspec_syntax 'shellspec_matcher_be_block_device'
shellspec_syntax_compound 'shellspec_matcher_be_charactor'
shellspec_syntax 'shellspec_matcher_be_charactor_device'
shellspec_syntax_compound 'shellspec_matcher_be_character'
shellspec_syntax 'shellspec_matcher_be_character_device'

shellspec_make_file_matcher() {
SHELLSPEC_EVAL="
Expand Down Expand Up @@ -51,4 +51,4 @@ shellspec_make_file_matcher readable "-r" "is readable"
shellspec_make_file_matcher writable "-w" "is writable"

shellspec_make_file_matcher block_device "-b" "is a block device"
shellspec_make_file_matcher charactor_device "-c" "is a charactor device"
shellspec_make_file_matcher character_device "-c" "is a character device"
2 changes: 1 addition & 1 deletion sample/spec/11.matcher_spec.sh
Expand Up @@ -36,7 +36,7 @@ Describe 'matcher sample'

# There are many other stat matchers.
# be empty, be symlink, be pipe, be socket, be readable, be writable,
# be executable, be block_device, be charactor_device,
# be executable, be block_device, be character_device,
# has setgid, has setuid
End

Expand Down
22 changes: 11 additions & 11 deletions spec/core/matchers/be/stat_spec.sh
Expand Up @@ -274,29 +274,29 @@ Describe "core/matchers/be/stat.sh"
End
End

Describe 'be charactor device matcher'
Skip if "not exist charactor-device file" not_exist "stat/charactor-device"
Describe 'be character device matcher'
Skip if "not exist character-device file" not_exist "stat/character-device"

Example 'example'
Path charactor-device="$FIXTURE/stat/charactor-device"
The path charactor-device should be charactor device
Path character-device="$FIXTURE/stat/character-device"
The path character-device should be character device
End

It 'matches when path is charactor device'
subject() { %- "$FIXTURE/stat/charactor-device"; }
When run shellspec_matcher_be_charactor_device
It 'matches when path is character device'
subject() { %- "$FIXTURE/stat/character-device"; }
When run shellspec_matcher_be_character_device
The status should be success
End

It 'does not match when path is not charactor device'
It 'does not match when path is not character device'
subject() { %- "$FIXTURE/file"; }
When run shellspec_matcher_be_charactor_device
When run shellspec_matcher_be_character_device
The status should be failure
End

It 'outputs error if parameters count is invalid'
subject() { %- "$FIXTURE/stat/charactor-device"; }
When run shellspec_matcher_be_charactor_device foo
subject() { %- "$FIXTURE/stat/character-device"; }
When run shellspec_matcher_be_character_device foo
The stderr should equal SYNTAX_ERROR_WRONG_PARAMETER_COUNT
End
End
Expand Down
2 changes: 1 addition & 1 deletion spec/libexec/translator_spec.sh
Expand Up @@ -106,7 +106,7 @@ Describe "libexec/translator.sh"
The variable desc should eq "'\$foo' bar"
End

It 'does not escape meta charactor'
It 'does not escape meta character'
When call escape_one_line_syntax desc "var[2] * ? \\ end"
The variable desc should eq "var[2] * ? \\ end"
End
Expand Down
2 changes: 1 addition & 1 deletion spec/support/fixture_stat_task.sh
Expand Up @@ -121,7 +121,7 @@ fixture_stat_files() {
"$1" file "$fixture/stat/setuid" a=,u+s "---S"
"$1" file "$fixture/stat/setgid" a=,g+s "------S"
"$1" device "$fixture/stat/block-device" b 0 0 # Unnamed devices
"$1" device "$fixture/stat/charactor-device" c 1 3 # Null device
"$1" device "$fixture/stat/character-device" c 1 3 # Null device
}

fixture_stat_prepare_task() {
Expand Down

0 comments on commit 4551950

Please sign in to comment.