Coverage improvements: - pkg/build: 89.4% - pkg/release: 86.7% (from 36.7%) - pkg/container: 85.7% - pkg/php: 62.1% (from 26%) - pkg/devops: 56.7% (from 33.1%) - pkg/release/publishers: 54.7% Also: - Add GEMINI.md for Gemini agent guidance - Update .gitignore to exclude coverage files - Remove stray core.go at root - Add core go cov command for coverage reports Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
61 lines
1.4 KiB
Go
61 lines
1.4 KiB
Go
package devops
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestClaudeOptions_Default(t *testing.T) {
|
|
opts := ClaudeOptions{}
|
|
assert.False(t, opts.NoAuth)
|
|
assert.Nil(t, opts.Auth)
|
|
assert.Empty(t, opts.Model)
|
|
}
|
|
|
|
func TestClaudeOptions_Custom(t *testing.T) {
|
|
opts := ClaudeOptions{
|
|
NoAuth: true,
|
|
Auth: []string{"gh", "anthropic"},
|
|
Model: "opus",
|
|
}
|
|
assert.True(t, opts.NoAuth)
|
|
assert.Equal(t, []string{"gh", "anthropic"}, opts.Auth)
|
|
assert.Equal(t, "opus", opts.Model)
|
|
}
|
|
|
|
func TestFormatAuthList_Good_NoAuth(t *testing.T) {
|
|
opts := ClaudeOptions{NoAuth: true}
|
|
result := formatAuthList(opts)
|
|
assert.Equal(t, " (none)", result)
|
|
}
|
|
|
|
func TestFormatAuthList_Good_Default(t *testing.T) {
|
|
opts := ClaudeOptions{}
|
|
result := formatAuthList(opts)
|
|
assert.Equal(t, ", gh, anthropic, git", result)
|
|
}
|
|
|
|
func TestFormatAuthList_Good_CustomAuth(t *testing.T) {
|
|
opts := ClaudeOptions{
|
|
Auth: []string{"gh"},
|
|
}
|
|
result := formatAuthList(opts)
|
|
assert.Equal(t, ", gh", result)
|
|
}
|
|
|
|
func TestFormatAuthList_Good_MultipleAuth(t *testing.T) {
|
|
opts := ClaudeOptions{
|
|
Auth: []string{"gh", "ssh", "git"},
|
|
}
|
|
result := formatAuthList(opts)
|
|
assert.Equal(t, ", gh, ssh, git", result)
|
|
}
|
|
|
|
func TestFormatAuthList_Good_EmptyAuth(t *testing.T) {
|
|
opts := ClaudeOptions{
|
|
Auth: []string{},
|
|
}
|
|
result := formatAuthList(opts)
|
|
assert.Equal(t, ", gh, anthropic, git", result)
|
|
}
|