func TestLoadPreviousBuildOptionsMapMissingFile(t *testing.T) {
	ctx := &types.Context{}

	buildPath := SetupBuildPath(t, ctx)
	defer os.RemoveAll(buildPath)

	command := builder.LoadPreviousBuildOptionsMap{}
	err := command.Run(ctx)
	NoError(t, err)

	require.Empty(t, ctx.BuildOptionsJsonPrevious)
}
func TestLoadPreviousBuildOptionsMapMissingFile(t *testing.T) {
	context := make(map[string]interface{})

	buildPath := SetupBuildPath(t, context)
	defer os.RemoveAll(buildPath)

	command := builder.LoadPreviousBuildOptionsMap{}
	err := command.Run(context)
	NoError(t, err)

	require.False(t, utils.MapHas(context, constants.CTX_BUILD_OPTIONS_PREVIOUS_JSON))
}
func TestLoadPreviousBuildOptionsMap(t *testing.T) {
	ctx := &types.Context{}

	buildPath := SetupBuildPath(t, ctx)
	defer os.RemoveAll(buildPath)

	err := utils.WriteFile(filepath.Join(buildPath, constants.BUILD_OPTIONS_FILE), "test")
	NoError(t, err)

	command := builder.LoadPreviousBuildOptionsMap{}
	err = command.Run(ctx)
	NoError(t, err)

	require.Equal(t, "test", ctx.BuildOptionsJsonPrevious)
}
func TestLoadPreviousBuildOptionsMap(t *testing.T) {
	context := make(map[string]interface{})

	buildPath := SetupBuildPath(t, context)
	defer os.RemoveAll(buildPath)

	err := utils.WriteFile(filepath.Join(buildPath, constants.BUILD_OPTIONS_FILE), "test")
	NoError(t, err)

	command := builder.LoadPreviousBuildOptionsMap{}
	err = command.Run(context)
	NoError(t, err)

	require.Equal(t, "test", context[constants.CTX_BUILD_OPTIONS_PREVIOUS_JSON])
}