Sha256: d474b7e151043d9da2fbb641a060c39e4a0d60a307d4e31aa418c61426a33446

Contents?: true

Size: 744 Bytes

Versions: 1

Compression:

Stored size: 744 Bytes

Contents

# encoding: UTF-8

require 'spec_helper'

include Rosette::Core
include Rosette::Core::Validators

describe RepoValidator do
  let(:repo_name) { 'double_commit' }
  let(:fixture) { load_repo_fixture(repo_name) }
  let(:validator) { RepoValidator.new }

  let(:config) do
    Rosette.build_config do |config|
      config.add_repo(repo_name) do |repo_config|
        repo_config.set_path(fixture.working_dir.join('.git').to_s)
      end
    end
  end

  describe '#valid?' do
    it 'returns true if the repo exists' do
      expect(validator.valid?(repo_name, repo_name, config)).to be_truthy
    end

    it "returns false if the repo doesn't exist" do
      expect(validator.valid?('foobar', repo_name, config)).to be_falsy
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rosette-core-1.0.1 spec/core/validators/repo_validator_spec.rb