Memoizing at the Class level wreaks havoc on the specs.

This commit is contained in:
Chris Lowder
2011-10-19 18:01:31 +01:00
parent ada41ce311
commit 02c8d2cb10
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -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("=")
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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")