Sha256: bc027251efd3d42dc72c7de655ec5a58725880de8f69a925498551b9d1360fd0

Contents?: true

Size: 642 Bytes

Versions: 64

Compression:

Stored size: 642 Bytes

Contents

require 'spec_helper'
require 'r10k/settings/uri_definition'

describe R10K::Settings::URIDefinition do

  subject { described_class.new(:uri) }

  it "passes validation if a value has not been set" do
    expect(subject.validate).to be_nil
  end

  it "passes validation when given a valid url" do
    subject.assign("http://definitely.a/url")
    expect(subject.validate).to be_nil
  end

  it "raises an error when given an invalid URL" do
    subject.assign("That's no URI!")
    expect {
      subject.validate
    }.to raise_error(ArgumentError, "Setting uri requires a URL but 'That's no URI!' could not be parsed as a URL")
  end
end

Version data entries

64 entries across 64 versions & 2 rubygems

Version Path
r10k-3.15.0 spec/unit/settings/uri_definition_spec.rb
akerl-r10k-3.14.2.1 spec/unit/settings/uri_definition_spec.rb
r10k-3.14.2 spec/unit/settings/uri_definition_spec.rb
r10k-3.14.1 spec/unit/settings/uri_definition_spec.rb
r10k-3.14.0 spec/unit/settings/uri_definition_spec.rb
r10k-3.13.0 spec/unit/settings/uri_definition_spec.rb
r10k-3.12.1 spec/unit/settings/uri_definition_spec.rb
r10k-3.12.0 spec/unit/settings/uri_definition_spec.rb
r10k-3.11.0 spec/unit/settings/uri_definition_spec.rb
r10k-3.10.0 spec/unit/settings/uri_definition_spec.rb
r10k-3.9.3 spec/unit/settings/uri_definition_spec.rb
r10k-3.9.2 spec/unit/settings/uri_definition_spec.rb
r10k-3.9.1 spec/unit/settings/uri_definition_spec.rb
r10k-3.9.0 spec/unit/settings/uri_definition_spec.rb
r10k-3.8.0 spec/unit/settings/uri_definition_spec.rb
r10k-3.7.0 spec/unit/settings/uri_definition_spec.rb
r10k-3.6.0 spec/unit/settings/uri_definition_spec.rb
r10k-2.6.9 spec/unit/settings/uri_definition_spec.rb
r10k-3.5.2 spec/unit/settings/uri_definition_spec.rb
r10k-3.5.1 spec/unit/settings/uri_definition_spec.rb