2009-06-20 14:28:39 +00:00
|
|
|
#!/bin/zsh
|
2004-08-19 19:37:07 +00:00
|
|
|
|
2007-02-20 09:20:38 +00:00
|
|
|
if [ "$1" = "" ]; then
|
2004-08-19 19:37:07 +00:00
|
|
|
echo 'Name?'
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2012-03-12 12:45:15 +00:00
|
|
|
name="${${1%.rb}//-/_}"
|
2012-01-05 19:07:21 +00:00
|
|
|
max_num=(test*(.On[1]))
|
2021-07-15 13:32:55 +00:00
|
|
|
let next_num=${max_num[1][6,9]}+1
|
2009-06-20 14:28:39 +00:00
|
|
|
|
2021-07-15 13:32:55 +00:00
|
|
|
new_file="test-$(printf '%04d' ${next_num})${name}.rb"
|
2009-06-20 14:28:39 +00:00
|
|
|
|
|
|
|
cat > "$new_file" <<EOF
|
2004-08-19 19:37:07 +00:00
|
|
|
#!/usr/bin/ruby -w
|
|
|
|
|
2012-01-31 17:59:27 +00:00
|
|
|
# T_${next_num}${name}
|
|
|
|
describe "FIXTHIS"
|
2012-01-27 18:29:02 +00:00
|
|
|
|
2012-01-31 17:59:27 +00:00
|
|
|
setup do
|
|
|
|
# FIXTHIS
|
|
|
|
end
|
2012-01-27 18:29:02 +00:00
|
|
|
|
2012-01-31 17:59:27 +00:00
|
|
|
cleanup do
|
|
|
|
# FIXTHIS
|
|
|
|
end
|
2004-08-19 19:37:07 +00:00
|
|
|
|
2012-01-31 17:59:27 +00:00
|
|
|
test_merge "data/FIXTHIS"
|
|
|
|
test_merge "data/FIXTHIS", :args => "FIXTHIS"
|
2012-01-27 18:29:02 +00:00
|
|
|
|
2012-01-31 17:59:27 +00:00
|
|
|
test "data/FIXTHIS" do
|
|
|
|
# INSERT COMMANDS
|
|
|
|
hash_tmp
|
2004-08-19 19:37:07 +00:00
|
|
|
end
|
|
|
|
EOF
|
2009-06-20 14:28:39 +00:00
|
|
|
|
|
|
|
echo "New file is $new_file"
|