Permalink
Browse files

Tweak get_property tests for YAML changes

  • Loading branch information...
1 parent bfde108 commit 228a5675b9ba1e3fa969a89f679554202be85c87 @ryanbrainard ryanbrainard committed May 15, 2012
Showing with 33 additions and 1 deletion.
  1. +33 −1 test/get_property_test.sh
View
@@ -5,6 +5,14 @@
EXPECTED_VERSION=0.1.5.9
+testGetPropertyFileMissing()
+{
+ capture get_property missing.properties application.version
+
+ assertCapturedSuccess
+ assertCapturedEquals ""
+}
+
testGetPropertyMissing()
{
cat > ${OUTPUT_DIR}/sample.properties <<EOF
@@ -111,7 +119,7 @@ EOF
assertCapturedEquals "-${EXPECTED_VERSION}-zAc-"
}
-testGetPropertyWithNoEqualsSignNoSpaces() {
+testGetPropertyWithNoSpaces() {
cat > ${OUTPUT_DIR}/sample.properties <<EOF
- application.version1234
EOF
@@ -129,6 +137,30 @@ EOF
assertCapturedEquals ""
}
+testGetPropertyWithNoLeadingDash()
+{
+ cat > ${OUTPUT_DIR}/sample.properties <<EOF
+ application.version 1234
+EOF
+
+ capture get_property ${OUTPUT_DIR}/sample.properties application.version
+
+ assertCapturedSuccess
+ assertCapturedEquals ""
+}
+
+testGetPropertyWithNoLeadingSpaces()
+{
+ cat > ${OUTPUT_DIR}/sample.properties <<EOF
+- application.version ${EXPECTED_VERSION}
+EOF
+
+ capture get_property ${OUTPUT_DIR}/sample.properties application.version
+
+ assertCapturedSuccess
+ assertCapturedEquals "${EXPECTED_VERSION}"
+}
+
testGetPropertyWithSimilarNames() {
cat > ${OUTPUT_DIR}/sample.properties <<EOF
- application.version ${EXPECTED_VERSION}

0 comments on commit 228a567

Please sign in to comment.