Adapt tests

This commit is contained in:
Ettore Di Giacinto 2019-11-08 18:30:53 +01:00
parent 3920f9a5ac
commit 639d4438e1
No known key found for this signature in database
GPG Key ID: 1ADA699B145A2D1C
4 changed files with 13 additions and 13 deletions

View File

@ -16,15 +16,16 @@
package compiler_test
import (
"io/ioutil"
"os"
"path/filepath"
. "github.com/mudler/luet/pkg/compiler"
helpers "github.com/mudler/luet/pkg/helpers"
pkg "github.com/mudler/luet/pkg/package"
"github.com/mudler/luet/pkg/tree"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"io/ioutil"
"os"
"path/filepath"
)
var _ = Describe("Spec", func() {
@ -45,9 +46,9 @@ var _ = Describe("Spec", func() {
lspec, ok := spec.(*LuetCompilationSpec)
Expect(ok).To(BeTrue())
Expect(lspec.Steps).To(Equal([]string{"echo foo", "bar"}))
Expect(lspec.Steps).To(Equal([]string{"echo foo > /test", "echo bar > /test2"}))
Expect(lspec.Image).To(Equal("luet/base"))
Expect(lspec.Seed).To(Equal("luet/baseimage"))
Expect(lspec.Seed).To(Equal("alpine"))
tmpdir, err := ioutil.TempDir("", "tree")
Expect(err).ToNot(HaveOccurred())
defer os.RemoveAll(tmpdir) // clean up
@ -57,7 +58,7 @@ var _ = Describe("Spec", func() {
dockerfile, err := helpers.Read(filepath.Join(tmpdir, "Dockerfile"))
Expect(err).ToNot(HaveOccurred())
Expect(dockerfile).To(Equal(`
FROM luet/baseimage
FROM alpine
COPY . /luetbuild
WORKDIR /luetbuild
`))
@ -68,8 +69,8 @@ WORKDIR /luetbuild
Expect(err).ToNot(HaveOccurred())
Expect(dockerfile).To(Equal(`
FROM luet/base
RUN echo foo
RUN bar`))
RUN echo foo > /test
RUN echo bar > /test2`))
})

View File

@ -129,7 +129,6 @@ func (p *DefaultPackage) GetPath() string {
func (p *DefaultPackage) Rel(s string) string {
return filepath.Join(p.GetPath(), s)
}
func (p *DefaultPackage) SetPath(s string) {

View File

@ -40,7 +40,7 @@ var _ = Describe("GentooBuilder", func() {
p, err := tree.GetPackageSet().GetPackage(pid)
Expect(err).ToNot(HaveOccurred())
Expect(p.GetName()).To(ContainSubstring("pinentry"))
// Expect(p.GetVersion()).To(ContainSubstring("1."))
Expect(p.GetVersion()).To(ContainSubstring("1."))
}
})

View File

@ -1,5 +1,5 @@
image: "luet/base"
seed: "luet/baseimage"
seed: "alpine"
steps:
- echo foo
- bar
- echo foo > /test
- echo bar > /test2