Files
pack/core/providers/ruby/ruby_test.go
T
2025-03-26 09:07:21 -07:00

39 lines
665 B
Go

package ruby
import (
"testing"
"github.com/stretchr/testify/require"
testingUtils "github.com/railwayapp/railpack/core/testing"
)
func TestDetect(t *testing.T) {
tests := []struct {
name string
path string
want bool
}{
{
name: "ruby",
path: "../../../examples/ruby-vanilla",
want: true,
},
{
name: "no ruby",
path: "../../../examples/go-mod",
want: false,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
ctx := testingUtils.CreateGenerateContext(t, tt.path)
provider := RubyProvider{}
got, err := provider.Detect(ctx)
require.NoError(t, err)
require.Equal(t, tt.want, got)
})
}
}