Sha256: 25a31ab19478f31c225465e86f9e19853068a03c531c0192f2d80923289a110d

Contents?: true

Size: 1.29 KB

Versions: 4

Compression:

Stored size: 1.29 KB

Contents

describe Rscons do
  describe ".clean" do
    it "removes all build targets and created directories" do
      cache = "cache"
      Rscons::Cache.should_receive(:instance).and_return(cache)
      cache.should_receive(:targets).and_return(["build/a.out", "build/main.o"])
      FileUtils.should_receive(:rm_f).with("build/a.out")
      FileUtils.should_receive(:rm_f).with("build/main.o")
      cache.should_receive(:directories).and_return(["build/one", "build/one/two", "build", "other"])
      File.should_receive(:directory?).with("build/one/two").and_return(true)
      Dir.should_receive(:entries).with("build/one/two").and_return([".", ".."])
      Dir.should_receive(:rmdir).with("build/one/two")
      File.should_receive(:directory?).with("build/one").and_return(true)
      Dir.should_receive(:entries).with("build/one").and_return([".", ".."])
      Dir.should_receive(:rmdir).with("build/one")
      File.should_receive(:directory?).with("build").and_return(true)
      Dir.should_receive(:entries).with("build").and_return([".", ".."])
      Dir.should_receive(:rmdir).with("build")
      File.should_receive(:directory?).with("other").and_return(true)
      Dir.should_receive(:entries).with("other").and_return([".", "..", "other.file"])
      cache.should_receive(:clear)

      Rscons.clean
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rscons-1.4.3 spec/rscons_spec.rb
rscons-1.4.2 spec/rscons_spec.rb
rscons-1.4.1 spec/rscons_spec.rb
rscons-1.4.0 spec/rscons_spec.rb