Commit 19ed7d8d authored by Sam Stewart's avatar Sam Stewart

[fix] unit tests now passing

parent 2408e993
......@@ -18,3 +18,4 @@ spec/fixtures/integration/Headers/
spec/fixtures/mercurial-repo/.hg/*cache
.hg
spec/fixtures/vcr
bin/RKTwitter
......@@ -129,6 +129,7 @@ module Pod
git "remote add upstream #{@url}" # we need to add the original url, not the cache url
git "fetch -q upstream" # refresh the branches
git "checkout --track -b activated-pod-commit upstream/#{options[:branch]}" # create a new tracking branch
puts "Just downloaded and checked out branch: #{options[:branch]} from upstream #{clone_url}"
end
end
......@@ -151,7 +152,7 @@ module Pod
end
def download_branch
download_only ? download_and_extract_tarball(options[:head]) : super
download_only? ? download_and_extract_tarball(options[:branch]) : super
end
def clean
......
......@@ -18,12 +18,23 @@ describe "Pod::Downloader" do
(@pod.root + 'README').read.strip.should == 'first commit'
end
it "check's out a specific branch" do
@pod.specification.stubs(:source).returns(
:git => fixture('banana-lib'), :branch => 'topicbranch'
)
downloader = Pod::Downloader.for_pod(@pod)
downloader.download
(@pod.root + 'README').read.strip.should == 'topicbranch'
end
it "check's out a specific tag" do
@pod.specification.stubs(:source).returns(
:git => fixture('banana-lib'), :tag => 'v1.0'
)
downloader = Pod::Downloader.for_pod(@pod)
downloader.download
(@pod.root + 'README').read.strip.should == 'v1.0'
end
......@@ -61,10 +72,24 @@ describe "Pod::Downloader" do
VCR.use_cassette('tarballs', :record => :new_episodes) { downloader.download }
# deliberately keep this assertion as loose as possible for now
(@pod.root + 'libPusher.podspec').readlines.grep(/1.1/).should.not.be.empty
end
it "downloads a specific branch when specified" do
@pod.specification.stubs(:source).returns(
:git => "git://github.com/lukeredpath/libPusher.git", :branch => 'gh-pages', :download_only => true
)
downloader = Pod::Downloader.for_pod(@pod)
VCR.use_cassette('tarballs', :record => :new_episodes) { downloader.download }
# deliberately keep this assertion as loose as possible for now
(@pod.root + 'index.html').readlines.grep(/libPusher Documentation/).should.not.be.empty
end
it "downloads a specific commit when specified" do
@pod.specification.stubs(:source).returns(
:git => "git://github.com/lukeredpath/libPusher.git", :commit => 'eca89998d5', :download_only => true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment