Sha256: b3b1acaf42e775a4633b3952646ff911ae52e724597d98e4df041a87dfd9033d

Contents?: true

Size: 1.19 KB

Versions: 1

Compression:

Stored size: 1.19 KB

Contents

require 'spec_helper'

module TeamcityRuby
  describe VcsRoot do
    before do
      delete_all_vcs_roots
    end

    it "lists all vcs roots", :vcr do
      vcs_root_names = ["VCS Root 1", "VCS Root 2"]

      vcs_root_names.each do |name|
        VcsRoot.create(:name => name) do |vcs_root|
          vcs_root['url'] = 'git@example.com/repo.git'
        end
      end

      VcsRoot.all.map(&:name).should == vcs_root_names
    end

    it "sets git as default vcs type" do
      vcs_root = VcsRoot.create(:name => "Sample") do |vcs_root|
        vcs_root['url'] = 'git@example.com/repo.git'
      end
      vcs_root.vcs_type.should == "jetbrains.git"
      vcs_root.properties.should include({"url" => "git@example.com/repo.git"})
    end

    it "accepts vcs type as plain string" do
      vcs_root = VcsRoot.create(:name => "Sample", :vcs_type => "svn") do |vcs_root|
        vcs_root['url'] = 'svn.example.com/repo'
      end
      vcs_root.vcs_type.should == "svn"
    end

    it "accepts vcs type as symbol" do
      vcs_root = VcsRoot.create(:name => "Sample", :vcs_type => :svn) do |vcs_root|
        vcs_root['url'] = 'svn.example.com/repo'
      end
      vcs_root.vcs_type.should == "svn"
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
teamcity_ruby-0.0.6 spec/teamcity_ruby/vcs_root_spec.rb