summaryrefslogtreecommitdiffstats
path: root/spec/unit/util/cache_accumulator_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/util/cache_accumulator_spec.rb')
-rw-r--r--spec/unit/util/cache_accumulator_spec.rb18
1 files changed, 12 insertions, 6 deletions
diff --git a/spec/unit/util/cache_accumulator_spec.rb b/spec/unit/util/cache_accumulator_spec.rb
index 2d976d0b1..3b5d68118 100644
--- a/spec/unit/util/cache_accumulator_spec.rb
+++ b/spec/unit/util/cache_accumulator_spec.rb
@@ -25,16 +25,22 @@ describe Puppet::Util::CacheAccumulator do
end
it 'should delegate bulk lookups to find with appropriate arguments and returning result count' do
- @test_class.expects(:find).with(:all,
- :conditions => {:name => ['a', 'b', 'c']}
- ).returns(['a','b','c'].collect {|n| @test_class.new(n)}).once
+
+ @test_class.expects(:find).with(
+ :all,
+
+ :conditions => {:name => ['a', 'b', 'c']}
+ ).returns(['a','b','c'].collect {|n| @test_class.new(n)}).once
@test_class.accumulate_by_name('a', 'b', 'c').should == 3
end
it 'should only need find_or_create_by_name lookup for missing bulk entries' do
- @test_class.expects(:find).with(:all,
- :conditions => {:name => ['a', 'b']}
- ).returns([ @test_class.new('a') ]).once
+
+ @test_class.expects(:find).with(
+ :all,
+
+ :conditions => {:name => ['a', 'b']}
+ ).returns([ @test_class.new('a') ]).once
@test_class.expects(:find_or_create_by_name).with('b').returns(@test_class.new('b')).once
@test_class.expects(:find_or_create_by_name).with('a').never
@test_class.accumulate_by_name('a','b').should == 1