MCPcopy Create free account
hub / github.com/gavv/httpexpect / TestChain_Root

Function TestChain_Root

chain_test.go:520–548  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

518}
519
520func TestChain_Root(t *testing.T) {
521 t.Run("newChainWithConfig, non-empty path", func(t *testing.T) {
522 chain := newChainWithConfig("root", Config{
523 AssertionHandler: &mockAssertionHandler{},
524 }.withDefaults())
525
526 assert.Equal(t, []string{"root"}, chain.context.Path)
527 })
528
529 t.Run("newChainWithConfig, empty path", func(t *testing.T) {
530 chain := newChainWithConfig("", Config{
531 AssertionHandler: &mockAssertionHandler{},
532 }.withDefaults())
533
534 assert.Equal(t, []string{}, chain.context.Path)
535 })
536
537 t.Run("newChainWithDefaults, non-empty path", func(t *testing.T) {
538 chain := newChainWithDefaults("root", newMockReporter(t))
539
540 assert.Equal(t, []string{"root"}, chain.context.Path)
541 })
542
543 t.Run("newChainWithDefaults, empty path", func(t *testing.T) {
544 chain := newChainWithDefaults("", newMockReporter(t))
545
546 assert.Equal(t, []string{}, chain.context.Path)
547 })
548}
549
550func TestChain_Path(t *testing.T) {
551 path := func(c *chain) string {

Callers

nothing calls this directly

Calls 5

newChainWithConfigFunction · 0.85
newChainWithDefaultsFunction · 0.85
newMockReporterFunction · 0.85
withDefaultsMethod · 0.80
EqualMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…