Permalink
Browse files

add tests

  • Loading branch information...
1 parent dafcd74 commit 48080620120945d81ee0384c686edb9d4356efe2 @mpapis mpapis committed Feb 13, 2012
Showing with 29 additions and 0 deletions.
  1. +7 −0 .travis.yml
  2. +22 −0 test/simple_comment_test.sh
View
@@ -0,0 +1,7 @@
+language: ruby
+rvm:
+ - 1.9.3
+install: true
+before_install:
+ - gem install dtf-0.1.2
+script: 'dtf test/*'
@@ -0,0 +1,22 @@
+## setup
+source activate.sh
+
+test_dir="${TMPDIR:=/tmp}/_autoenv_$$"
+
+mkdir -p "$test_dir/a/b"
+echo "echo -a/b-" > "$test_dir/a/b/.env"
+echo "echo -a-" > "$test_dir/a/.env"
+mkdir -p "$test_dir/c/d"
+echo "echo -c/d-" > "$test_dir/c/d/.env"
+
+cd $test_dir
+
+## test
+( cd a ) # match=/-a-/ ; status=0
+( cd a/b ) # match=/-a-/ ; match=/-a/b-/ ; status=0
+( cd c ) # match=/$^/ ; status=0
+( cd c/d ) # match!=/-c-/ ; match=/-c/d-/ ; status=0
+( cd e ) # match!=/^$/ ; status!=0
+
+## teardown
+rm -rf "$test_dir"

0 comments on commit 4808062

Please sign in to comment.