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

- old
+ new

@@ -28,21 +28,21 @@ before do env.stub_chain(:cache_path, :exist?) { false } end it "should not try to clear the cache path" do - env.cache_path.should_receive(:rmtree).never + expect(env.cache_path).to receive(:rmtree).never end end context "when the cache path is present" do before do env.stub_chain(:cache_path, :exist?) { true } end it "should try to clear the cache path" do - env.cache_path.should_receive(:rmtree).exactly(:once) + expect(env.cache_path).to receive(:rmtree).exactly(:once) end end end @@ -56,11 +56,11 @@ before do env.stub_chain(:install_path, :exist?) { false } end it "should not try to clear the install path" do - env.install_path.should_receive(:children).never + expect(env.install_path).to receive(:children).never end end context "when the install path is present" do before do @@ -73,22 +73,22 @@ child.stub(:file?) { false } end env.stub_chain(:install_path, :children) { children } children.each do |child| - child.should_receive(:rmtree).exactly(:once) + expect(child).to receive(:rmtree).exactly(:once) end end it "should only try to clear out directories from the install path, not files" do 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 + expect(child).to receive(:rmtree).never end children.reject(&:file?).each do |child| - child.should_receive(:rmtree).exactly(:once) + expect(child).to receive(:rmtree).exactly(:once) end end end end