Commit b1993dc2 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

Test that coreEnvironment can't encode/decode

parent 575489fa
......@@ -3,6 +3,7 @@ package packer
import (
"bytes"
"cgl.tideland.biz/asserts"
"encoding/gob"
"os"
"strings"
"testing"
......@@ -23,6 +24,20 @@ func testEnvironment() Environment {
return env
}
// This is just a sanity test to prove that our coreEnvironment can't
// encode or decode using gobs. That is fine, and expected, but I just like
// to be sure.
func TestEnvironment_CoreEnvironmentCantEncode(t *testing.T) {
assert := asserts.NewTestingAsserts(t, true)
env := testEnvironment()
b := new(bytes.Buffer)
e := gob.NewEncoder(b)
err := e.Encode(env)
assert.NotNil(err, "encoding should fail")
}
func TestEnvironment_DefaultConfig_Command(t *testing.T) {
assert := asserts.NewTestingAsserts(t, true)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment