Sha256: bc3f285e10c60f207aea316e1c5f27e2672bbae9b79f85c7610ec00366aacfa2

Contents?: true

Size: 967 Bytes

Versions: 4

Compression:

Stored size: 967 Bytes

Contents

require 'spec_helper'
require 'r10k/module'

describe R10K::Module do
  describe 'delegating to R10K::Module::Git' do
    it "accepts args {:git => 'git url}" do
      obj = R10K::Module.new('foo', '/modulepath', :git => 'git url')
      expect(obj).to be_a_kind_of(R10K::Module::Git)
    end
  end

  describe 'delegating to R10K::Module::Git' do
    it "accepts name matching 'username/modulename' and no args" do
      obj = R10K::Module.new('bar/quux', '/modulepath', [])
      expect(obj).to be_a_kind_of(R10K::Module::Forge)
    end

    it "accepts name matching 'username/modulename' and a semver argument" do
      obj = R10K::Module.new('bar/quux', '/modulepath', '10.0.0')
      expect(obj).to be_a_kind_of(R10K::Module::Forge)
    end
  end

  it "raises an error if delegation fails" do
    expect {
      R10K::Module.new('bar-quux', '/modulepath', ["NOPE NOPE NOPE NOPE!"])
    }.to raise_error RuntimeError, /doesn't have an implementation/
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
r10k-1.5.1 spec/unit/module_spec.rb
r10k-1.4.2 spec/unit/module_spec.rb
r10k-1.4.1 spec/unit/module_spec.rb
r10k-1.4.0 spec/unit/module_spec.rb