diff --git a/Makefile b/Makefile index 8700416..f5e3db0 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,7 @@ -default: all - -all: c ruby +default: c ruby bootstrap: - cd ruby && bundle + cd ruby && bundle install --jobs 8 c: cd c && make test @@ -15,4 +13,4 @@ clean: cd c && make clean cd ruby && bundle exec rake clean -.PHONY: c ruby clean +.PHONY: c ruby clean bootstrap diff --git a/ruby/test/shell_test.rb b/ruby/test/shell_test.rb index 1663bde..70ca5ae 100644 --- a/ruby/test/shell_test.rb +++ b/ruby/test/shell_test.rb @@ -33,11 +33,13 @@ class ShellTest < Minitest::Test def test_background_job output = `#{A1_PATH} -c 'bg echo hello'`.gsub(/\e\[([;\d]+)?m/, "") pid = /\(pid (\d+)\)/.match(output)[1] - assert_equal "Running job 1 (pid #{pid}) in background\nhello\n", output + lines = output.split("\n").map(&:chomp) + assert_equal ["Running job 1 (pid #{pid}) in background", "hello"], lines.sort end def test_resolves_executables_with_absolute_paths - assert_equal "/usr/bin/which", `#{A1_PATH} -c '/usr/bin/which -a which'`.chomp + output = `#{A1_PATH} -c '/usr/bin/which -a which'`.lines.map(&:chomp) + assert_includes output, "/usr/bin/which" end def test_resolves_executables_with_relative_paths @@ -47,7 +49,8 @@ class ShellTest < Minitest::Test end def test_resolves_executables_in_absolute_paths - assert_equal "/usr/bin/which", `#{A1_PATH} -c 'which -a which'`.chomp + output = `#{A1_PATH} -c 'which -a which'`.lines.map(&:chomp) + assert_includes output, "/usr/bin/which" end def test_resolves_executables_in_relative_paths