1
2
3
4
5
6
7
8
9
10
11
12
13
14
require_relative "test_helper"

require "lox"

require "open3"

class TestLox < Lox::Test
  def test_error_on_more_than_one_arg
    lox_path = File.expand_path("../bin/lox", __dir__)
    o, s = Open3.capture2(lox_path, "foo", "bar")
    assert_equal 64, s.exitstatus
    assert_equal "Usage: #{lox_path} [script]\n", o
  end
end