summaryrefslogtreecommitdiff
path: root/test/functional/bin_test.rb
blob: bc15e38cd87d249807391b7091e01ded3f31a40a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
require 'minitest/autorun'
require 'minitest/pride'
require 'minitest/hell'

class BinTest < Minitest::Test

  def test_bin_loading
    assert_command_runs("version")
    assert_equal 0, $?.exitstatus
  end

  protected

  def assert_command_runs(command)
    out = `#{path_to_executable} #{command} 2>&1`
    assert ($?.exitstatus == 0),
      "failed to run 'nickserver #{command}':\n #{out}"
  end

  def path_to_executable
    File.expand_path(File.dirname(__FILE__) + '/../../bin/nickserver')
  end

end