require 'minitest/autorun'
require 'launchy'

class LaunchyTest < MiniTest::Test

  def test_calls_xdg_open
    args_used = nil
    system = lambda { |*args| args_used = args.clone }
    Launchy.stub :system, system do
      Launchy.open('http://www.debian.org/')
    end

    assert_equal ['xdg-open', 'http://www.debian.org/'], args_used
  end

end
