From 7800f4cd51cb837edd2d8b46f03e7dc61c91d2e2 Mon Sep 17 00:00:00 2001 From: Tim Flapper Date: Tue, 11 Aug 2015 16:06:40 +0200 Subject: [PATCH] Fix bug where funnel could not be set because hash doesn't exist --- lib/ab_panel.rb | 4 ++-- spec/ab_panel_spec.rb | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/ab_panel.rb b/lib/ab_panel.rb index 697ef18..ec25e33 100644 --- a/lib/ab_panel.rb +++ b/lib/ab_panel.rb @@ -63,11 +63,11 @@ def set_env(key, value) end def funnels - env['funnels'] ||= Set.new + env[:funnels] ||= Set.new end def funnels=(funnels) - Thread.current['ab_panel_env']['funnels'] = funnels + env[:funnels] = funnels end def add_funnel(funnel) diff --git a/spec/ab_panel_spec.rb b/spec/ab_panel_spec.rb index 5893abd..3d473fb 100644 --- a/spec/ab_panel_spec.rb +++ b/spec/ab_panel_spec.rb @@ -62,6 +62,10 @@ end describe ".funnels" do + before do + AbPanel.reset! + end + after do AbPanel.funnels = nil end