From 4dde6051578e35fcd4e7c445d627eecd747a6539 Mon Sep 17 00:00:00 2001 From: Mathieu Martin Date: Tue, 5 Aug 2008 11:51:22 -0400 Subject: [PATCH] More or less redid all the funk tests in light of the reworked test helper --- test/functional/grb_test.rb | 50 +++++++++++++++++++++++++++++++------ 1 file changed, 42 insertions(+), 8 deletions(-) diff --git a/test/functional/grb_test.rb b/test/functional/grb_test.rb index 1fa854e..7858875 100644 --- a/test/functional/grb_test.rb +++ b/test/functional/grb_test.rb @@ -3,18 +3,52 @@ class GRBTest < Test::Unit::TestCase include ShouldaFunctionalHelpers - on_a_new_repo do - in_directory_for :local1 do - context "creating a branch" do + on_a_repository do + context "creating a branch in a local clone" do + setup do + in_directory_for :local1 + #assert_match(/local1\Z/, execute('pwd').chomp) #Sanity check + + run_with 'create new_branch' + end + + should_have_branch 'new_branch', :local + should_have_branch 'new_branch', :remote + + context "the remote repository" do setup do - run_with "create new_branch" + in_directory_for :remote end - should_create_branch 'new_branch', :local - should_create_branch 'new_branch', :remote + should_have_branch 'new_branch', :local + end + + context "the other local clone, tracking the new branch" do + setup do + in_directory_for :local2 + assert_match(/local2\Z/, execute('pwd').chomp) #Sanity check + + run_with 'track new_branch' + end - in_directory_for :remote do - should_create_branch 'new_branch', :local + should_have_branch 'new_branch', :local + should_have_branch 'new_branch', :remote + end + + context "then deleting the branch" do + setup do + run_with 'delete new_branch' + end + + should_not_have_branch 'new_branch', :local + should_not_have_branch 'new_branch', :remote + + context "the remote repository" do + setup do + in_directory_for :remote + end + + should_not_have_branch 'new_branch', :local end end end