Sha256: 1d472ae4eee10f65ae5893d3e89244e5f84414d596ab0eeb7f43724e653cf017

Contents?: true

Size: 1.1 KB

Versions: 38

Compression:

Stored size: 1.1 KB

Contents

require 'al-test-utils'

class TestGroupdel < Test::Unit::TestCase
  include AlTestUtils

  def setup
    super
    @command = File.join(@examples_dir, "groupdel")
  end

  priority :must

  priority :normal
  def test_non_exist_group
    ensure_delete_group("test-group") do |name|
      assert(!@group_class.exists?(name))
      assert_equal([false, "Group #{name} doesn't exist.\n"], run_command(name))
      assert(!@group_class.exists?(name))
    end
  end

  def test_delete_group
    make_temporary_group do |group|
      assert_groupdel_successfully(group.id)
    end
  end

  private
  def assert_groupdel_successfully(name, *args, &block)
    _wrap_assertion do
      assert(@group_class.exists?(name))
      args.concat([name])
      assert_equal([true, ""], run_command(*args, &block))
      assert(!@group_class.exists?(name))
    end
  end

  def assert_groupdel_failed(name, message, *args, &block)
    _wrap_assertion do
      assert(@group_class.exists?(name))
      args.concat([name])
      assert_equal([false, message], run_command(*args, &block))
      assert(@group_class.exists?(name))
    end
  end
end

Version data entries

38 entries across 38 versions & 3 rubygems

Version Path
activeldap-7.2.1 test/test_groupdel.rb
activeldap-7.2.0 test/test_groupdel.rb
activeldap-7.0.0 test/test_groupdel.rb
activeldap-6.1.0 test/test_groupdel.rb
activeldap-6.0.4 test/test_groupdel.rb
activeldap-6.0.3 test/test_groupdel.rb
activeldap-6.0.2 test/test_groupdel.rb
activeldap-6.0.1 test/test_groupdel.rb
activeldap-6.0.0 test/test_groupdel.rb
activeldap-5.2.4 test/test_groupdel.rb
activeldap-5.2.3 test/test_groupdel.rb
activeldap-5.2.2 test/test_groupdel.rb
activeldap-5.2.1 test/test_groupdel.rb
activeldap-5.2.0 test/test_groupdel.rb
activeldap-5.1.1 test/test_groupdel.rb
activeldap-5.1.0 test/test_groupdel.rb
activeldap-3.2.3 test/test_groupdel.rb
powerhome-activeldap-3.2.3 test/test_groupdel.rb
activeldap-4.0.6 test/test_groupdel.rb
activeldap-4.0.5 test/test_groupdel.rb