From 7d0e6dc1a627f7d83509500436167d998cbb05d9 Mon Sep 17 00:00:00 2001 From: Dmytro Serdiuk Date: Fri, 24 Nov 2017 22:02:42 +0200 Subject: [PATCH] Start addons names from "addons-" prefix #97 --- CONTRIBUTING.md | 8 +++----- src/test/{fake-cd.bash => addons-cd.bash} | 0 src/test/{commons.bash => addons-common.bash} | 0 src/test/{fake-read.bash => addons-read.bash} | 0 src/test/git-elegant-add.bats | 4 ++-- src/test/git-elegant-check.bats | 2 +- src/test/git-elegant-clear-local.bats | 4 ++-- src/test/git-elegant-clone.bats | 6 +++--- src/test/git-elegant-configure.bats | 4 ++-- src/test/git-elegant-feature.bats | 2 +- src/test/git-elegant-init.bats | 4 ++-- src/test/git-elegant-pull.bats | 2 +- src/test/git-elegant-push-after-rebase.bats | 4 ++-- src/test/git-elegant-push.bats | 4 ++-- src/test/git-elegant-rebase.bats | 2 +- src/test/git-elegant.bats | 2 +- 16 files changed, 23 insertions(+), 25 deletions(-) rename src/test/{fake-cd.bash => addons-cd.bash} (100%) rename src/test/{commons.bash => addons-common.bash} (100%) rename src/test/{fake-read.bash => addons-read.bash} (100%) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 64e477d..17c908e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -15,12 +15,10 @@ Unit tests Addons ------ Add the following line to the test file if the extension is required: -- `load commons` to have the working test (**mandatory**) +- `load addons-common` to have the working test (**mandatory**) - `load addons-git` to interact with real git repository (**optional**) -- `load fake-cd` to fake `cd` unix command (**optional**) -- `load fake-read` to fake `read` unix command (**optional**) - -@todo #89 Use some name template for the addons. +- `load addons-cd` to fake `cd` unix command (**optional**) +- `load addons-read` to fake `read` unix command (**optional**) Bats restrictions ----------------- diff --git a/src/test/fake-cd.bash b/src/test/addons-cd.bash similarity index 100% rename from src/test/fake-cd.bash rename to src/test/addons-cd.bash diff --git a/src/test/commons.bash b/src/test/addons-common.bash similarity index 100% rename from src/test/commons.bash rename to src/test/addons-common.bash diff --git a/src/test/fake-read.bash b/src/test/addons-read.bash similarity index 100% rename from src/test/fake-read.bash rename to src/test/addons-read.bash diff --git a/src/test/git-elegant-add.bats b/src/test/git-elegant-add.bats index 98ee46d..51da0df 100644 --- a/src/test/git-elegant-add.bats +++ b/src/test/git-elegant-add.bats @@ -1,7 +1,7 @@ #!/usr/bin/env bats -load commons -load fake-read +load addons-common +load addons-read setup() { fake-pass git "ls-files -m" src/test/git-elegant diff --git a/src/test/git-elegant-check.bats b/src/test/git-elegant-check.bats index bccbf85..15ad5e2 100644 --- a/src/test/git-elegant-check.bats +++ b/src/test/git-elegant-check.bats @@ -1,6 +1,6 @@ #!/usr/bin/env bats -load commons +load addons-common load addons-git preconditions() { diff --git a/src/test/git-elegant-clear-local.bats b/src/test/git-elegant-clear-local.bats index c8fbfcc..8bbb94e 100644 --- a/src/test/git-elegant-clear-local.bats +++ b/src/test/git-elegant-clear-local.bats @@ -1,7 +1,7 @@ #!/usr/bin/env bats -ex -load commons -load fake-read +load addons-common +load addons-read setup() { fake-pass git "branch -lvv" "first [gone]" diff --git a/src/test/git-elegant-clone.bats b/src/test/git-elegant-clone.bats index d95a56b..6644556 100644 --- a/src/test/git-elegant-clone.bats +++ b/src/test/git-elegant-clone.bats @@ -1,8 +1,8 @@ #!/usr/bin/env bats -ex -load commons -load fake-read -load fake-cd +load addons-common +load addons-read +load addons-cd setup() { fake-pass git clone diff --git a/src/test/git-elegant-configure.bats b/src/test/git-elegant-configure.bats index ad08b11..5f8b23d 100644 --- a/src/test/git-elegant-configure.bats +++ b/src/test/git-elegant-configure.bats @@ -1,7 +1,7 @@ #!/usr/bin/env bats -load commons -load fake-read +load addons-common +load addons-read setup() { fake-pass git "elegant commands" diff --git a/src/test/git-elegant-feature.bats b/src/test/git-elegant-feature.bats index 6ac8f2c..eeda640 100644 --- a/src/test/git-elegant-feature.bats +++ b/src/test/git-elegant-feature.bats @@ -1,6 +1,6 @@ #!/usr/bin/env bats -ex -load commons +load addons-common setup() { fake-pass git "elegant pull master" diff --git a/src/test/git-elegant-init.bats b/src/test/git-elegant-init.bats index 020c1f7..1427389 100644 --- a/src/test/git-elegant-init.bats +++ b/src/test/git-elegant-init.bats @@ -1,7 +1,7 @@ #!/usr/bin/env bats -load commons -load fake-read +load addons-common +load addons-read setup() { fake-pass git init diff --git a/src/test/git-elegant-pull.bats b/src/test/git-elegant-pull.bats index d5a4c1e..ad49e38 100644 --- a/src/test/git-elegant-pull.bats +++ b/src/test/git-elegant-pull.bats @@ -1,6 +1,6 @@ #!/usr/bin/env bats -load commons +load addons-common @test "exit code is 0 when run 'git-elegant pull' without parameters" { fake-pass git "fetch --tags" diff --git a/src/test/git-elegant-push-after-rebase.bats b/src/test/git-elegant-push-after-rebase.bats index 20d19e0..dfe522a 100644 --- a/src/test/git-elegant-push-after-rebase.bats +++ b/src/test/git-elegant-push-after-rebase.bats @@ -1,7 +1,7 @@ #!/usr/bin/env bats -ex -load commons -load fake-read +load addons-common +load addons-read setup() { fake-pass git "elegant rebase" diff --git a/src/test/git-elegant-push.bats b/src/test/git-elegant-push.bats index 1107062..92ceb6c 100644 --- a/src/test/git-elegant-push.bats +++ b/src/test/git-elegant-push.bats @@ -1,7 +1,7 @@ #!/usr/bin/env bats -load commons -load fake-read +load addons-common +load addons-read setup() { fake-pass git branch *master diff --git a/src/test/git-elegant-rebase.bats b/src/test/git-elegant-rebase.bats index 37deb78..5bbffed 100644 --- a/src/test/git-elegant-rebase.bats +++ b/src/test/git-elegant-rebase.bats @@ -1,6 +1,6 @@ #!/usr/bin/env bats -load commons +load addons-common setup() { fake-pass git "fetch --tags" diff --git a/src/test/git-elegant.bats b/src/test/git-elegant.bats index ba906af..2eb81e8 100644 --- a/src/test/git-elegant.bats +++ b/src/test/git-elegant.bats @@ -1,6 +1,6 @@ #!/usr/bin/env bats -load commons +load addons-common @test "print available commands when run 'git-elegant commands'" { run git-elegant commands