Sha256: 9bc280617152bb727a8469a88eae6c05a1ee9d4bb868763ef1f2ea8ad555d2d8

Contents?: true

Size: 659 Bytes

Versions: 2

Compression:

Stored size: 659 Bytes

Contents

require 'assert'
require 'fileutils'
require 'pathname'

require 'cap-util/shared_path'

module CapUtil

  class SharedPathTests < Assert::Context
    desc "the SharedPath util"
    setup do
      @fake_cap = FakeCap.new
      @fake_cap.shared_path = Pathname.new File.expand_path("tmp/shared")

      @shared_path = SharedPath.new(@fake_cap)
    end
    subject { @shared_path }

    should have_imeths :rm_rf

    should "remove a given relative path with the `rm_rf` method" do
      subject.rm_rf 'cached-copy'
      exp_cmd = "rm -rf #{File.expand_path("tmp/shared/cached-copy")}"

      assert_equal exp_cmd, @fake_cap.cmds_run.last
    end

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cap-util-1.1.0 test/shared_path_tests.rb
cap-util-1.0.1 test/shared_path_tests.rb