From 28e5c99816b595502e594f7b2a7a9e92f018fcdf Mon Sep 17 00:00:00 2001 From: Ivan Povalyukhin Date: Sat, 28 Mar 2015 18:21:52 -0700 Subject: [PATCH] added test example for plugin and lib --- test/lib/composure.bats | 2 +- test/plugins/ruby.plugin.bats | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100755 test/plugins/ruby.plugin.bats diff --git a/test/lib/composure.bats b/test/lib/composure.bats index f2a42191..af4bc8cf 100755 --- a/test/lib/composure.bats +++ b/test/lib/composure.bats @@ -3,7 +3,7 @@ load ../test_helper load ../../lib/composure -@test "composure_keywords()" { +@test "lib composure: composure_keywords()" { run composure_keywords assert_output "about author example group param version" } diff --git a/test/plugins/ruby.plugin.bats b/test/plugins/ruby.plugin.bats new file mode 100755 index 00000000..2328e6e8 --- /dev/null +++ b/test/plugins/ruby.plugin.bats @@ -0,0 +1,16 @@ +#!/usr/bin/env bats + +load ../test_helper +load ../../lib/composure +load ../../plugins/available/ruby.plugin + +@test "plugins ruby: remove_gem is defined" { + run type remove_gem + assert_line 1 "remove_gem () " +} + + +@test "plugins ruby: PATH includes ~/.gem/ruby/bin" { + last_path_entry=$(echo $PATH | tr ":" "\n" | tail -1); + [[ "${last_path_entry}" == "${HOME}"/.gem/ruby/*/bin ]] +}