spec/unit/action/clean_spec.rb in librarian-0.1.0 vs spec/unit/action/clean_spec.rb in librarian-0.1.1

- old
+ new

@@ -1,11 +1,11 @@ require "librarian/action/clean" module Librarian describe Action::Clean do - let(:env) { mock } + let(:env) { double } let(:action) { described_class.new(env) } before do action.stub(:debug) end @@ -66,11 +66,11 @@ before do env.stub_chain(:install_path, :exist?) { true } end it "should try to clear the install path" do - children = [mock, mock, mock] + children = [double, double, double] children.each do |child| child.stub(:file?) { false } end env.stub_chain(:install_path, :children) { children } @@ -78,10 +78,10 @@ child.should_receive(:rmtree).exactly(:once) end end it "should only try to clear out directories from the install path, not files" do - children = [mock(:file? => false), mock(:file? => true), mock(:file? => true)] + children = [double(:file? => false), double(:file? => true), double(:file? => true)] env.stub_chain(:install_path, :children) { children } children.select(&:file?).each do |child| child.should_receive(:rmtree).never end