Skip to content

Commit

Permalink
Add usage, work on test
Browse files Browse the repository at this point in the history
  • Loading branch information
thewoolleyman committed Jan 17, 2010
1 parent 0112e49 commit f4a4769
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion setup_chef
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env bash

echo $*
echo 'Usage: setup_chef -e existing_user -u user -h host -k public_key_file -r rvm_version -c chef_command???'
6 changes: 3 additions & 3 deletions test/setup_chef_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
require 'fileutils'

class SetupChefTest < Test::Unit::TestCase
def test_prompts
assert_equal 'foo', sc(['foo']).readlines.first.strip
def test_help
assert_match /Usage/, runit([], ['--help']).readlines.first
end

def sc(args)
def runit(input, args = [])
cmd = 'sh setup_chef ' + args.join(' ')
FileUtils.cd(File.dirname(__FILE__) + '/..') do
return IO.popen(cmd)
Expand Down

0 comments on commit f4a4769

Please sign in to comment.