Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix remote tests by reloading config
  • Loading branch information
phatblat committed Jun 23, 2015
commit dbe237ab53703721becd34c3efebdb98c18d4148
9 changes: 8 additions & 1 deletion ObjectiveGitTests/GTRemoteSpec.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@

__block GTRemote *remote = nil;
__block GTRepository *repository = nil;
__block GTConfiguration *configuration = nil;
NSString *fetchRefspec = @"+refs/heads/*:refs/remotes/origin/*";

beforeEach(^{
repository = self.testAppFixtureRepository;
expect(repository).notTo(beNil());

NSError *error = nil;
GTConfiguration *configuration = [repository configurationWithError:&error];
configuration = [repository configurationWithError:&error];
expect(configuration).notTo(beNil());
expect(error).to(beNil());

Expand Down Expand Up @@ -53,6 +54,9 @@
expect(@([remote updateURLString:newURLString error:&error])).to(beTruthy());
expect(error).to(beNil());

// Reload remote from disk to pick up the change
remote = configuration.remotes[0];

expect(remote.URLString).to(equal(newURLString));
});

Expand All @@ -65,6 +69,9 @@
expect(@([remote addFetchRefspec:newFetchRefspec error:&error])).to(beTruthy());
expect(error).to(beNil());

// Reload remote from disk to pick up the change
remote = configuration.remotes[0];

expect(remote.fetchRefspecs).to(equal((@[ fetchRefspec, newFetchRefspec ])));
});
});
Expand Down