updated unit tests to account for quoted env vars

This commit is contained in:
Brad Rydzewski 2014-11-01 11:41:02 -07:00
parent f21fd563e8
commit 5022db8d55
3 changed files with 7 additions and 7 deletions

View file

@ -40,7 +40,7 @@ func Test_Modulus(t *testing.T) {
}
m.Write(b)
g.Assert(b.String()).Equal(`export MODULUS_TOKEN=bar
g.Assert(b.String()).Equal(`export MODULUS_TOKEN="bar"
[ -f /usr/bin/npm ] || echo ERROR: npm is required for modulus.io deployments
[ -f /usr/bin/npm ] || exit 1
[ -f /usr/bin/sudo ] || npm install -g modulus

View file

@ -40,8 +40,8 @@ func Test_Modulus(t *testing.T) {
}
n.Write(b)
g.Assert(b.String()).Equal(`export username=foo
export apiToken=bar
g.Assert(b.String()).Equal(`export username="foo"
export apiToken="bar"
[ -f /usr/bin/sudo ] || npm install -g jitsu
[ -f /usr/bin/sudo ] && sudo npm install -g jitsu
echo '#DRONE:6a69747375206465706c6f79'

View file

@ -81,7 +81,7 @@ func TestSSHOneArtifact(t *testing.T) {
t.Fatalf("Can't unmarshal deploy script: %s", err)
}
if !strings.Contains(bscr, "ARTIFACT=build.result") {
if !strings.Contains(bscr, `ARTIFACT="build.result"`) {
t.Error("Expect script to contains artifact")
}
@ -96,7 +96,7 @@ func TestSSHMultiArtifact(t *testing.T) {
t.Fatalf("Can't unmarshal deploy script: %s", err)
}
if !strings.Contains(bscr, "ARTIFACT=${PWD##*/}.tar.gz") {
if !strings.Contains(bscr, `ARTIFACT="${PWD##*/}.tar.gz"`) {
t.Errorf("Expect script to contains artifact")
}
@ -111,11 +111,11 @@ func TestSSHGitArchive(t *testing.T) {
t.Fatalf("Can't unmarshal deploy script: %s", err)
}
if !strings.Contains(bscr, "COMMIT=$(git rev-parse HEAD)") {
if !strings.Contains(bscr, `COMMIT="$(git rev-parse HEAD)"`) {
t.Errorf("Expect script to contains commit ref")
}
if !strings.Contains(bscr, "ARTIFACT=${PWD##*/}-${COMMIT}.tar.gz") {
if !strings.Contains(bscr, `ARTIFACT="${PWD##*/}-${COMMIT}.tar.gz"`) {
t.Errorf("Expect script to contains artifact")
}