Skip to content

Commit

Permalink
[ISSUE-35] add getRealT
Browse files Browse the repository at this point in the history
  • Loading branch information
siller174 committed Mar 17, 2024
1 parent 0c7c5f6 commit 592bb00
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/framework/core/common/step_context_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ type providerTMockStep struct {
failNow bool
failed bool
name string

testingT provider.TestingT
}

func (m *providerTMockStep) Break(args ...interface{}) {
Expand Down Expand Up @@ -87,7 +89,11 @@ func (m *providerTMockStep) Helper() {
}

func (m *providerTMockStep) GetRealT() provider.TestingT {
return nil
return m.testingT
}

func (m *providerTMockStep) SetRealT(realT provider.TestingT) {
m.testingT = realT
}

type providerMockStep struct {
Expand Down Expand Up @@ -243,6 +249,7 @@ func TestStepCtx_Step(t *testing.T) {

func TestStepCtx_Errorf_withParent(t *testing.T) {
mockT := new(providerTMockStep)
mockT.SetRealT(t)
parentStep := allure.NewSimpleStep("parentStep")
parentCtx := &stepCtx{t: mockT, currentStep: parentStep}
step := allure.NewSimpleStep("testStep")
Expand Down

0 comments on commit 592bb00

Please sign in to comment.