Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cucumber_cpp/library/engine/ContextManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ namespace cucumber_cpp::library::engine
: contextManager{ contextManager }
{}

ContextManager::ScopedFeautureContext ::~ScopedFeautureContext()
ContextManager::ScopedFeautureContext::~ScopedFeautureContext()
{
contextManager.DisposeFeatureContext();
}
Expand All @@ -90,7 +90,7 @@ namespace cucumber_cpp::library::engine
: contextManager{ contextManager }
{}

ContextManager::ScopedRuleContext ::~ScopedRuleContext()
ContextManager::ScopedRuleContext::~ScopedRuleContext()
{
contextManager.DisposeRuleContext();
}
Expand All @@ -99,7 +99,7 @@ namespace cucumber_cpp::library::engine
: contextManager{ contextManager }
{}

ContextManager::ScopedScenarioContext ::~ScopedScenarioContext()
ContextManager::ScopedScenarioContext::~ScopedScenarioContext()
{
contextManager.DisposeScenarioContext();
}
Expand Down
2 changes: 1 addition & 1 deletion cucumber_cpp/library/engine/HookExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ namespace cucumber_cpp::library::engine
{}

HookExecutor::StepScope::StepScope(cucumber_cpp::library::engine::ContextManager& contextManager)
: ScopedHook{ contextManager.StepContext(), stepHooks, contextManager.ScenarioContext().info.Tags() }
: ScopedHook{ contextManager.ScenarioContext(), stepHooks, contextManager.ScenarioContext().info.Tags() }
{}

HookExecutorImpl::HookExecutorImpl(cucumber_cpp::library::engine::ContextManager& contextManager)
Expand Down
8 changes: 4 additions & 4 deletions cucumber_cpp/library/engine/test/TestHookExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ namespace cucumber_cpp::library::engine

TEST_F(TestHookExecutor, ExecuteBeforeStep)
{
ASSERT_FALSE(contextManagerInstance.StepContext().Contains("hookBeforeStep"));
ASSERT_FALSE(contextManagerInstance.StepContext().Contains("hookAfterStep"));
ASSERT_FALSE(contextManagerInstance.ScenarioContext().Contains("hookBeforeStep"));
ASSERT_FALSE(contextManagerInstance.ScenarioContext().Contains("hookAfterStep"));

{
auto scope = hookExecutor.StepStart();
EXPECT_TRUE(contextManagerInstance.StepContext().Contains("hookBeforeStep"));
EXPECT_TRUE(contextManagerInstance.ScenarioContext().Contains("hookBeforeStep"));
}
EXPECT_TRUE(contextManagerInstance.StepContext().Contains("hookAfterStep"));
EXPECT_TRUE(contextManagerInstance.ScenarioContext().Contains("hookAfterStep"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ namespace cucumber_cpp::library::engine::test_helper
{
ContextManagerInstance()
: cucumber_cpp::library::engine::ContextManager{ contextStorageFactory }
, featureContextScope{ CreateFeatureContext(feature) }
, ruleContextScope{ CreateRuleContext(rule) }
, scenarioContextScope{ CreateScenarioContext(scenario) }
, stepContextScope{ CreateStepContext(step) }
{
}

Expand All @@ -35,10 +31,10 @@ namespace cucumber_cpp::library::engine::test_helper
cucumber_cpp::library::engine::ScenarioInfo scenario{ rule, {}, {}, {}, {}, {} };
cucumber_cpp::library::engine::StepInfo step{ scenario, {}, {}, {}, {}, {} };

ContextManager::ScopedFeautureContext featureContextScope;
ContextManager::ScopedRuleContext ruleContextScope;
ContextManager::ScopedScenarioContext scenarioContextScope;
ContextManager::ScopedStepContext stepContextScope;
ContextManager::ScopedFeautureContext featureContextScope{ CreateFeatureContext(feature) };
ContextManager::ScopedRuleContext ruleContextScope{ CreateRuleContext(rule) };
ContextManager::ScopedScenarioContext scenarioContextScope{ CreateScenarioContext(scenario) };
ContextManager::ScopedStepContext stepContextScope{ CreateStepContext(step) };
};
}

Expand Down
Loading