summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/sample/rewrite_shebangs/usr/bin/shell-script5
-rw-r--r--test/unit/dh_ruby_test.rb4
2 files changed, 9 insertions, 0 deletions
diff --git a/test/sample/rewrite_shebangs/usr/bin/shell-script b/test/sample/rewrite_shebangs/usr/bin/shell-script
new file mode 100644
index 0000000..c070e3d
--- /dev/null
+++ b/test/sample/rewrite_shebangs/usr/bin/shell-script
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+set -e
+
+echo "Hello, world!"
diff --git a/test/unit/dh_ruby_test.rb b/test/unit/dh_ruby_test.rb
index 0d0afdb..99ad3ff 100644
--- a/test/unit/dh_ruby_test.rb
+++ b/test/unit/dh_ruby_test.rb
@@ -153,6 +153,10 @@ class DhRubyTest < Gem2DebTestCase
assert_match %r{/usr/bin/env ruby}, lines[0]
assert_match /puts/, lines[1]
end
+ should 'not rewrite shebangs non-Ruby scripts' do
+ lines = File.readlines(self.class.tmpdir + '/rewrite_shebangs/usr/bin/shell-script')
+ assert_match %r{/bin/sh}, lines[0]
+ end
should 'leave programs with correct permissions after rewriting shebangs' do
assert_equal '100755', '%o' % File.stat(self.class.tmpdir + '/rewrite_shebangs/usr/bin/no-shebang').mode
end