-
-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(slug): keep period in slug variable
BREAKING CHANGE: The previous slug function is rename slug_url to be able to still use itin the subdomain of an url. Co-authored-by: Marc Schiller <m4rc.schiller@gmail.com>
- Loading branch information
1 parent
250b75d
commit e95fe45
Showing
8 changed files
with
142 additions
and
47 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#!/usr/bin/env bats | ||
|
||
@test "slug_url_ref: master branch" { | ||
test_slug_url_ref \ | ||
"refs/heads/master" \ | ||
"master" | ||
} | ||
|
||
@test "slug_url_ref: a feature branch" { | ||
test_slug_url_ref \ | ||
"refs/heads/feat/new_feature" \ | ||
"feat-new-feature" | ||
} | ||
|
||
@test "slug_url_ref: a fix branch" { | ||
test_slug_url_ref \ | ||
"refs/heads/fix/issue_number" \ | ||
"fix-issue-number" | ||
} | ||
|
||
@test "slug_url_ref: a simple tag" { | ||
test_slug_url_ref \ | ||
"refs/tags/v1.0.0" \ | ||
"v1-0-0" | ||
} | ||
|
||
@test "slug_url_ref: a complex tag" { | ||
test_slug_url_ref \ | ||
"refs/tags/product@1.0.0-rc.2" \ | ||
"product-1-0-0-rc-2" | ||
} | ||
|
||
@test "slug_url_ref: a reference with upper case letters" { | ||
test_slug_url_ref \ | ||
"refs/heads/New_Awesome_Product" \ | ||
"new-awesome-product" | ||
} | ||
|
||
@test "slug_url_ref: a very long name" { | ||
test_slug_url_ref \ | ||
"refs/heads/an-awesome-Feature-Very-Very-Very-Very-Very-Very-Very-Long-moreThan63Characters" \ | ||
"an-awesome-feature-very-very-very-very-very-very-very-long-more" | ||
} | ||
|
||
# Load sluf_ref function | ||
source entrypoint.sh > /dev/null 2>&1 | ||
|
||
test_slug_url_ref() { | ||
given="${1}" | ||
expected="${2}" | ||
|
||
actual="$(slug_url_ref \"${given}\")" | ||
echo "expected : [${expected}], actual : [${actual}]" | ||
[ "${actual}" == "${expected}" ] | ||
} |