Sha256: bf251f96a614f26e80b527cb2331e1bf74a771732fe07e627f2837670919037b

Contents?: true

Size: 984 Bytes

Versions: 24

Compression:

Stored size: 984 Bytes

Contents

# frozen_string_literal: true

module AssertScmAttrHelper
  def get_core(scm_type, opts = {})
    OhlohScm::Factory.get_core({ scm_type: scm_type, url: 'foobar' }.merge(opts))
  end

  def assert_url_error(scm_type, *urls)
    urls.each do |url|
      core = get_core(scm_type, url: url)
      core.validation.send(:url_errors).wont_be :empty?
    end
  end

  def assert_url_valid(scm_type, url)
    core = get_core(scm_type, url: url)
    core.validation.send(:url_errors).must_be_nil
  end

  def assert_branch_name_error(scm_type, *branches)
    branches.each do |branch_name|
      core = get_core(scm_type, url: ':pserver:cvs:cvs@cvs.test.org:/test', branch_name: branch_name)
      core.validation.send(:branch_name_errors).wont_be :empty?
    end
  end

  def assert_branch_name_valid(scm_type, branch_name)
    core = get_core(scm_type, url: ':pserver:cvs:cvs@cvs.test.org:/test', branch_name: branch_name)
    core.validation.send(:branch_name_errors).must_be_nil
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
ohloh_scm-4.0.5 spec/helpers/assert_scm_attr_helper.rb
ohloh_scm-4.0.4 spec/helpers/assert_scm_attr_helper.rb
ohloh_scm-4.0.3 spec/helpers/assert_scm_attr_helper.rb
ohloh_scm-4.0.2 spec/helpers/assert_scm_attr_helper.rb
ohloh_scm-4.0.1 spec/helpers/assert_scm_attr_helper.rb
ohloh_scm-3.0.21 spec/helpers/assert_scm_attr_helper.rb
ohloh_scm-3.0.19 spec/helpers/assert_scm_attr_helper.rb
ohloh_scm-3.0.17 spec/helpers/assert_scm_attr_helper.rb
ohloh_scm-3.0.16 spec/helpers/assert_scm_attr_helper.rb
ohloh_scm-3.0.15 spec/helpers/assert_scm_attr_helper.rb
ohloh_scm-3.0.14 spec/helpers/assert_scm_attr_helper.rb
ohloh_scm-3.0.13 spec/helpers/assert_scm_attr_helper.rb
ohloh_scm-3.0.12 spec/helpers/assert_scm_attr_helper.rb
ohloh_scm-3.0.11 spec/helpers/assert_scm_attr_helper.rb
ohloh_scm-3.0.10 spec/helpers/assert_scm_attr_helper.rb
ohloh_scm-3.0.9 spec/helpers/assert_scm_attr_helper.rb
ohloh_scm-3.0.8 spec/helpers/assert_scm_attr_helper.rb
ohloh_scm-3.0.7 spec/helpers/assert_scm_attr_helper.rb
ohloh_scm-3.0.6 spec/helpers/assert_scm_attr_helper.rb
ohloh_scm-3.0.5 spec/helpers/assert_scm_attr_helper.rb