From c1f492755b8774005b3627da8ee001ee0b2df4eb Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Mon, 17 Mar 2014 19:26:08 -0600 Subject: [PATCH] Improve WORKDIR test to cover more edge cases Docker-DCO-1.1-Signed-off-by: Andrew Page (github: tianon) --- integration/buildfile_test.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/integration/buildfile_test.go b/integration/buildfile_test.go index 9c986d74c2..95d5abb8a7 100644 --- a/integration/buildfile_test.go +++ b/integration/buildfile_test.go @@ -445,16 +445,18 @@ func TestBuildRelativeWorkdir(t *testing.T) { img, err := buildImage(testContextTemplate{` FROM {IMAGE} RUN [ "$PWD" = '/' ] - WORKDIR /test1 + WORKDIR test1 RUN [ "$PWD" = '/test1' ] - WORKDIR test2 - RUN [ "$PWD" = '/test1/test2' ] + WORKDIR /test2 + RUN [ "$PWD" = '/test2' ] + WORKDIR test3 + RUN [ "$PWD" = '/test2/test3' ] `, nil, nil}, t, nil, true) if err != nil { t.Fatal(err) } - if img.Config.WorkingDir != "/test1/test2" { - t.Fail() + if img.Config.WorkingDir != "/test2/test3" { + t.Fatalf("Expected workdir to be '/test2/test3', received '%s'", img.Config.WorkingDir) } }