From 02c8d2cb10172ccf0c611fa77d654de2796cf88c Mon Sep 17 00:00:00 2001 From: Chris Lowder Date: Wed, 19 Oct 2011 18:01:31 +0100 Subject: [PATCH] Memoizing at the Class level wreaks havoc on the specs. --- lib/foreman/utils.rb | 2 +- spec/foreman/export/bluepill_spec.rb | 2 +- spec/foreman/export/upstart_spec.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/foreman/utils.rb b/lib/foreman/utils.rb index 1970bd4..b29ee85 100644 --- a/lib/foreman/utils.rb +++ b/lib/foreman/utils.rb @@ -3,7 +3,7 @@ require "foreman" class Foreman::Utils def self.parse_concurrency(concurrency) - @concurrency ||= begin + begin pairs = concurrency.to_s.gsub(/\s/, "").split(",") pairs.inject(Hash.new(1)) do |hash, pair| process, amount = pair.split("=") diff --git a/spec/foreman/export/bluepill_spec.rb b/spec/foreman/export/bluepill_spec.rb index 35d74e6..dd71d87 100644 --- a/spec/foreman/export/bluepill_spec.rb +++ b/spec/foreman/export/bluepill_spec.rb @@ -12,7 +12,7 @@ describe Foreman::Export::Bluepill do before(:each) { stub(bluepill).say } it "exports to the filesystem" do - bluepill.export("/tmp/init") + bluepill.export("/tmp/init", :concurrency => "alpha=2") File.read("/tmp/init/app.pill").should == example_export_file("bluepill/app.pill") end diff --git a/spec/foreman/export/upstart_spec.rb b/spec/foreman/export/upstart_spec.rb index b06dfda..62b3d91 100644 --- a/spec/foreman/export/upstart_spec.rb +++ b/spec/foreman/export/upstart_spec.rb @@ -12,7 +12,7 @@ describe Foreman::Export::Upstart do before(:each) { stub(upstart).say } it "exports to the filesystem" do - upstart.export("/tmp/init") + upstart.export("/tmp/init", :concurrency => "alpha=2") File.read("/tmp/init/app.conf").should == example_export_file("upstart/app.conf") File.read("/tmp/init/app-alpha.conf").should == example_export_file("upstart/app-alpha.conf")