Sha256: a85fe89b971964e8b67db440c771fde089288a10a762425fb404d831662c580c

Contents?: true

Size: 880 Bytes

Versions: 11

Compression:

Stored size: 880 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/../test_helper')

describe ::Repomen::Retriever do
  let(:described_class) { ::Repomen::Retriever }
  let(:url) { "git@bitbucket.org:atlassian_tutorial/helloworld.git" }
  let(:incorrect_url) { "git@bitbucket.org:atlassian_tutorial/helloworld123.git" }

  it "should retrieve the repo" do
    retriever = described_class.new(url)
    assert retriever.retrieved?
    assert File.exist?(retriever.path)

    retriever.discard_repo
    assert !File.exist?(retriever.path)
  end

  it "should retrieve the repo" do
    retriever = described_class.new(incorrect_url)
    refute retriever.retrieved?
  end

  it "should retrieve the repo, yield to block and discard the repo" do
    @path = nil
    described_class.new(url) do |path|
      @path = path
      assert File.exist?(@path)
    end
    assert !File.exist?(@path)
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
repomen-0.2.1 test/repomen/retriever_test.rb
repomen-0.2.0 test/repomen/retriever_test.rb
repomen-0.2.0.rc1 test/repomen/retriever_test.rb
repomen-0.1.8 test/repomen/retriever_test.rb
repomen-0.1.7 test/repomen/retriever_test.rb
repomen-0.1.6 test/repomen/retriever_test.rb
repomen-0.1.5 test/repomen/retriever_test.rb
repomen-0.1.4 test/repomen/retriever_test.rb
repomen-0.1.3 test/repomen/retriever_test.rb
repomen-0.1.2 test/repomen/retriever_test.rb
repomen-0.1.1 test/repomen/retriever_test.rb