Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Spec and command for DsclStore#empty

  • Loading branch information...
commit eb0eff8255886a9edb012216f62eecb431c76e27 1 parent f5bd6d0
@bjeanes authored
View
1  lib/ghost/store/dscl_store.rb
@@ -64,6 +64,7 @@ def delete(host)
end
def empty
+ all.each { |host| Dscl.delete(domain, host.name) }
end
end
end
View
9 spec/ghost/store/dscl_store_spec.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.