<commit_before>require 'minitest/autorun'

$LOAD_PATH << File.join(File.dirname(__FILE__), '..', 'lib')
require 'teamspeak-ruby'

class TeamspeakTest < MiniTest::Unit::TestCase
  def setup
    @ts = Teamspeak::Client.new
    @ts.login('serveradmin', 'travis_test')
    @ts.command('use', {'sid' => 1})
  end

  def test_get_hostinfo
    assert(@ts.command('hostinfo')['host_timestamp_utc'])
  end

  def test_get_clients
    @ts.command('clientlist').each do |user|
      assert(user['client_nickname'])
    end
  end

  def test_get_serverinfo
    assert_equal(@ts.command('serverinfo')['virtualserver_name'], 'TeamSpeak ]I[ Server')
  end

  def teardown
    @ts.disconnect
  end
end<commit_msg>Test flood protection<commit_after>require 'minitest/autorun'

$LOAD_PATH << File.join(File.dirname(__FILE__), '..', 'lib')
require 'teamspeak-ruby'

class TeamspeakTest < MiniTest::Unit::TestCase
  def setup
    @ts = Teamspeak::Client.new
    @ts.login('serveradmin', 'travis_test')
    @ts.command('use', {'sid' => 1})
  end

  def test_get_hostinfo
    assert(@ts.command('hostinfo')['host_timestamp_utc'])
  end

  def test_get_clients
    @ts.command('clientlist').each do |user|
      assert(user['client_nickname'])
    end
  end

  def test_get_serverinfo
    assert_equal(@ts.command('serverinfo')['virtualserver_name'], 'TeamSpeak ]I[ Server')
  end

  def test_flood_protection
    15.times do
      assert(@ts.command('hostinfo')['host_timestamp_utc'])
    end
  end

  def teardown
    @ts.disconnect
  end
end
{'fraction_non_alphanumeric': 0.1452991452991453, 'fraction_numerical': 0.0026298487836949377, 'mean_word_length': 4.3780918727915195, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '452198', 'n_tokens_mistral': 553, 'n_tokens_neox': 530, 'n_words': 96}