From c676785d55790748f6e12c1bb3b28dc82451eca3 Mon Sep 17 00:00:00 2001 From: Sebastian Serth Date: Sun, 17 Oct 2021 19:32:55 +0200 Subject: [PATCH] Fix order-dependent runner_spec.rb --- spec/models/runner_spec.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/spec/models/runner_spec.rb b/spec/models/runner_spec.rb index 0a496b24..bd99f4bb 100644 --- a/spec/models/runner_spec.rb +++ b/spec/models/runner_spec.rb @@ -34,15 +34,12 @@ describe Runner do let(:runner_management_config) { {runner_management: {enabled: true, strategy: strategy}} } before do + # Ensure to reset the memorized helper + described_class.instance_variable_set :@strategy_class, nil allow(CodeOcean::Config).to receive(:new).with(:code_ocean).and_return(codeocean_config) allow(codeocean_config).to receive(:read).and_return(runner_management_config) end - after do - # Reset the memorized helper - described_class.remove_instance_variable :@strategy_class - end - it "uses #{strategy_class} as strategy class for constant #{strategy}" do expect(described_class.strategy_class).to eq(strategy_class) end