test/test_licensee_bin.rb in licensee-8.1.0 vs test/test_licensee_bin.rb in licensee-8.2.0
- old
+ new
@@ -1,12 +1,14 @@
require 'helper'
class TestLicenseeBin < Minitest::Test
should 'work via commandline' do
root = File.expand_path '..', File.dirname(__FILE__)
- Dir.chdir root
- stdout, stderr, status = Open3.capture3("#{root}/bin/licensee")
+ stdout, stderr, status = Dir.chdir root do
+ args = [windows? && 'ruby', 'bin/licensee'].compact
+ Open3.capture3(*args)
+ end
msg = "expected #{stdout} to include `License: MIT`"
assert stdout.include?('License: MIT'), msg
msg = "expected #{stdout} to include `Matched file: LICENSE.md`"
@@ -16,11 +18,13 @@
assert stderr.empty?
end
should 'work via commandline with file argument' do
root = File.expand_path '..', File.dirname(__FILE__)
- Dir.chdir root
- stdout, stderr, status = Open3.capture3("#{root}/bin/licensee LICENSE.md")
+ stdout, stderr, status = Dir.chdir root do
+ args = [windows? && 'ruby', 'bin/licensee', 'LICENSE.md'].compact
+ Open3.capture3(*args)
+ end
msg = "expected #{stdout} to include `License: MIT`"
assert stdout.include?('License: MIT'), msg
msg = "expected #{stdout} to include `Matched file: LICENSE.md`"