Sha256: 84eed5a15925c12224a84a6d3946d697adb3173415af5ef8e60a44469c9569c1

Contents?: true

Size: 1.6 KB

Versions: 3

Compression:

Stored size: 1.6 KB

Contents

class DevSystem::DirShellTest < DevSystem::FileShellTest

  test :subject_class do
    assert subject_class == DevSystem::DirShell
  end

  test :settings do
    assert subject_class.log_level == :normal
    assert subject_class.log_color == :green
  end

  #

  test :subject_class, :exist?, :raise do
    assert_raises ArgumentError do
      subject_class.exist? nil
    end

    assert_raises ArgumentError do
      subject_class.exist? ""
    end
  end

  test :subject_class, :exist?, true do
    assert subject_class.exist? Dir.pwd
    assert subject_class.exist? Liza::Shell.source_location_radical
  end

  test :subject_class, :exist?, false do
    refute subject_class.exist? "does_not_exist"
    refute subject_class.exist? Liza::DirShell.source_location_radical
  end

  test :subject_class, :size, :raise do
    assert_raises ArgumentError do
      subject_class.size nil
    end

    assert_raises ArgumentError do
      subject_class.size ""
    end

    assert_raises ArgumentError do
      subject_class.size "does_not_exist"
    end
  end

  test :subject_class, :size, true do
    assert subject_class.size(Dir.pwd).positive?
    assert subject_class.size(Liza::Shell.source_location_radical).positive?
  end

  #

  test :subject_class, :create, :raise do
    assert_raises ArgumentError do
      subject_class.create nil
    end

    assert_raises ArgumentError do
      subject_class.create ""
    end
  end

  test :subject_class, :create, true do
    path = tmp_dir.join "create_#{Time.now.to_i}"
    refute subject_class.exist? path

    subject_class.create path
    assert subject_class.exist? path
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
lizarb-1.0.4 lib/dev_system/dev/controllers/shell/dir_shell_test.rb
lizarb-1.0.3 lib/dev_system/dev/controllers/shell/dir_shell_test.rb
lizarb-1.0.2 lib/dev_system/dev/controllers/shell/dir_shell_test.rb