util_test.go 447 B

1234567891011121314151617181920212223
  1. package util
  2. import (
  3. "github.com/stretchr/testify/require"
  4. "strings"
  5. "testing"
  6. )
  7. func TestLoadResourceSimple(t *testing.T) {
  8. assert := require.New(t)
  9. expected := `services:
  10. - debian-console
  11. - ubuntu-console
  12. `
  13. expected = strings.TrimSpace(expected)
  14. b, e := LoadResource("https://raw.githubusercontent.com/rancherio/os-services/v0.3.4/index.yml", true, []string{})
  15. assert.Nil(e)
  16. assert.Equal(expected, strings.TrimSpace(string(b)))
  17. }