| author | Antonio Terceiro <terceiro@softwarelivre.org> | |
| Sat, 24 Sep 2011 19:02:15 +0000 (12:02 -0700) | ||
| committer | Antonio Terceiro <terceiro@softwarelivre.org> | |
| Sat, 24 Sep 2011 19:02:15 +0000 (12:02 -0700) |
| test/sample/rewrite_shebangs/usr/bin/shell-script | [new file with mode: 0644] | patch | blob |
| test/unit/dh_ruby_test.rb | patch | blob | history |
diff --git a/test/sample/rewrite_shebangs/usr/bin/shell-script b/test/sample/rewrite_shebangs/usr/bin/shell-script
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+set -e
+
+echo "Hello, world!"
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
