Skip to content

Commit

Permalink
Completed basic setup for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
colszowka committed Jan 26, 2011
1 parent 96ba492 commit c040494
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions test/shoulda_macros.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module ShouldaMacros
TEMP_DIR = File.expand_path(File.join(File.dirname(__FILE__), '..', 'tmp'))
TEMP_DIR = File.expand_path('/tmp/capita_git_tmp')

# Test method level helpers
module InstanceMethods
Expand All @@ -22,8 +22,8 @@ def in_dir(name)

# Runs the specified command and asserts it's exit status should be 0
def assert_command(cmd)
Open4.popen4(cmd) { |stdin, stdout, stderr| 'nothing to do' }
assert_equal 0, $?.exitstatus, "Expected exit status of 0!"
Open4.popen4(cmd) { |stdin, stdout, stderr| }
assert_equal 0, $?.exitstatus, "Expected exit status of 0 for command '#{cmd}'."
end
end

Expand All @@ -49,7 +49,9 @@ def with_a_repo_setup
end

in_dir "local_checkout_2" do
assert_command "git clone #{temp_dir('origin')}"
assert_command "git clone #{temp_dir('origin')} ."
assert_command 'git tag -a 1.0.0 -m "First release"'
assert_command 'git push --tags origin master'
end
end

Expand Down

0 comments on commit c040494

Please sign in to comment.