Permalink
Browse files

Spec and command for DsclStore#empty

  • Loading branch information...
bjeanes committed Apr 24, 2012
1 parent f5bd6d0 commit eb0eff8255886a9edb012216f62eecb431c76e27
Showing with 9 additions and 1 deletion.
  1. +1 −0 lib/ghost/store/dscl_store.rb
  2. +8 −1 spec/ghost/store/dscl_store_spec.rb
@@ -64,6 +64,7 @@ def delete(host)
end
def empty
+ all.each { |host| Dscl.delete(domain, host.name) }
end
end
end
@@ -142,5 +142,12 @@
end
end
- describe "#empty"
+ describe "#empty" do
+ it 'deletes all the entries' do
+ store.stub(:all => [Ghost::Host.new('foo'), Ghost::Host.new('bar')])
+ cmd.should_receive(:delete).with('localhost', 'foo')
+ cmd.should_receive(:delete).with('localhost', 'bar')
+ store.empty
+ end
+ end
end

0 comments on commit eb0eff8

Please sign in to comment.