Sha256: 2f97d98e0bc113e118442fdc201522fbd7fc825e34f009fe9ac7ba071fa47e1b

Contents?: true

Size: 1.02 KB

Versions: 2

Compression:

Stored size: 1.02 KB

Contents

require_relative "../../test_helper"
describe FoldersRenamer do
  before :each do
    @tmp_dir = Dir.mktmpdir(%w[foo bar])
    FileUtils.cd @tmp_dir
    FileUtils.mkdir_p "base/aa_!01/bb@02"
    @base_dir = "#{@tmp_dir}/base"
  end
  context "#rename" do
    it "works with default separator string" do
      skip("TODO: need to make the test pass")
      FileUtils.cd @base_dir
      FoldersRenamer.rename(base_dir: @base_dir, sep_string: ".", commit: true)
      filesystem do
        dir "base" do
          dir "aa.01" do
            dir "bb.02"
          end
        end
      end.must_exist_within File.absolute_path(@tmp_dir)
    end
    it "works with non-default separator string" do
      skip("TODO: need to make the test pass")
      FileUtils.cd @base_dir
      FoldersRenamer.rename(base_dir: @base_dir, sep_string: "_", commit: true)
      filesystem do
        dir "base" do
          dir "aa_01" do
            dir "bb_02"
          end
        end
      end.must_exist_within File.absolute_path(@tmp_dir)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
folders_renamer-0.2.5 test/lib/folders_renamer/test_folders_renamer.rb
folders_renamer-0.2.4 test/lib/folders_renamer/test_folders_renamer.rb