Commit 801e5aaa authored by Chris Bednarski's avatar Chris Bednarski

Move test configs into the test func

parent d02f6644
...@@ -54,19 +54,18 @@ func TestDetectFilename(t *testing.T) { ...@@ -54,19 +54,18 @@ func TestDetectFilename(t *testing.T) {
} }
} }
const simpleTestCase = ` func TestSimpleCompress(t *testing.T) {
{ const config = `
{
"post-processors": [ "post-processors": [
{ {
"type": "compress", "type": "compress",
"output": "package.tar.gz" "output": "package.tar.gz"
} }
] ]
} }
` `
artifact := testArchive(t, config)
func TestSimpleCompress(t *testing.T) {
artifact := testArchive(t, simpleTestCase)
defer artifact.Destroy() defer artifact.Destroy()
fi, err := os.Stat("package.tar.gz") fi, err := os.Stat("package.tar.gz")
...@@ -78,19 +77,19 @@ func TestSimpleCompress(t *testing.T) { ...@@ -78,19 +77,19 @@ func TestSimpleCompress(t *testing.T) {
} }
} }
const zipTestCase = ` func TestZipArchive(t *testing.T) {
{ const config = `
{
"post-processors": [ "post-processors": [
{ {
"type": "compress", "type": "compress",
"output": "package.zip" "output": "package.zip"
} }
] ]
} }
` `
func TestZipArchive(t *testing.T) { artifact := testArchive(t, config)
artifact := testArchive(t, zipTestCase)
defer artifact.Destroy() defer artifact.Destroy()
// Verify things look good // Verify things look good
...@@ -100,19 +99,19 @@ func TestZipArchive(t *testing.T) { ...@@ -100,19 +99,19 @@ func TestZipArchive(t *testing.T) {
} }
} }
const tarTestCase = ` func TestTarArchive(t *testing.T) {
{ const config = `
{
"post-processors": [ "post-processors": [
{ {
"type": "compress", "type": "compress",
"output": "package.tar" "output": "package.tar"
} }
] ]
} }
` `
func TestTarArchive(t *testing.T) { artifact := testArchive(t, config)
artifact := testArchive(t, tarTestCase)
defer artifact.Destroy() defer artifact.Destroy()
// Verify things look good // Verify things look good
...@@ -122,8 +121,9 @@ func TestTarArchive(t *testing.T) { ...@@ -122,8 +121,9 @@ func TestTarArchive(t *testing.T) {
} }
} }
const optionsTestCase = ` func TestCompressOptions(t *testing.T) {
{ const config = `
{
"post-processors": [ "post-processors": [
{ {
"type": "compress", "type": "compress",
...@@ -131,11 +131,10 @@ const optionsTestCase = ` ...@@ -131,11 +131,10 @@ const optionsTestCase = `
"compression_level": 9 "compression_level": 9
} }
] ]
} }
` `
func TestCompressOptions(t *testing.T) { artifact := testArchive(t, config)
artifact := testArchive(t, optionsTestCase)
defer artifact.Destroy() defer artifact.Destroy()
// Verify things look good // Verify things look good
......
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