MCPcopy Create free account
hub / github.com/exercism/cli / TestIncludesTestFilesInCommand

Function TestIncludesTestFilesInCommand

workspace/test_configurations_test.go:73–93  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

71}
72
73func TestIncludesTestFilesInCommand(t *testing.T) {
74 testConfig, ok := TestConfigurations["ruby"]
75 assert.True(t, ok, "unexpectedly unable to find ruby test config")
76
77 // this creates a config file in the test directory and removes it
78 dir := filepath.Join(".", ".exercism")
79 defer os.RemoveAll(dir)
80 err := os.Mkdir(dir, os.ModePerm)
81 assert.NoError(t, err)
82
83 f, err := os.Create(filepath.Join(dir, "config.json"))
84 assert.NoError(t, err)
85 defer f.Close()
86
87 _, err = f.WriteString(`{ "blurb": "Learn about the basics of Ruby by following a lasagna recipe.", "authors": ["iHiD", "pvcarrera"], "files": { "solution": ["lasagna.rb"], "test": ["lasagna_test.rb", "some_other_file.rb"], "exemplar": [".meta/exemplar.rb"] } } `)
88 assert.NoError(t, err)
89
90 cmd, err := testConfig.GetTestCommand()
91 assert.NoError(t, err)
92 assert.Equal(t, cmd, "ruby lasagna_test.rb some_other_file.rb")
93}
94
95func TestRustHasTrailingDashes(t *testing.T) {
96 testConfig, ok := TestConfigurations["rust"]

Callers

nothing calls this directly

Calls 1

GetTestCommandMethod · 0.80

Tested by

no test coverage detected