Sha256: fd1459216b0234acf39831894c2c58ec61e641c0fa2f917384e83b4852a07b94

Contents?: true

Size: 1.28 KB

Versions: 36

Compression:

Stored size: 1.28 KB

Contents

require 'spec_helper'
require 'r10k/action/puppetfile/cri_runner'

describe R10K::Action::Puppetfile::CriRunner do

  let(:action_class) do
    Class.new do
      attr_reader :opts
      attr_reader :argv

      def initialize(opts, argv)
        @opts = opts
        @argv = argv
      end

      def call
        @opts[:runok]
      end
    end
  end

  subject(:cri_runner) { described_class.wrap(action_class)  }

  let(:opts) { {:value => :yep} }
  let(:argv) { %w[value yes] }

  describe "handling options" do
    it "sets the root to the current wd" do
      expect(cri_runner).to receive(:wd).and_return('/some/nonexistent')
      expect(cri_runner.handle_opts({})).to include(:root => '/some/nonexistent')
    end

    describe "for the moduledir" do
      it "sets the option from the cli option if given" do
        opts = {:moduledir => '/some/other/nonexistent/modules'}
        expect(cri_runner.handle_opts(opts)).to include(:moduledir => '/some/other/nonexistent/modules')
      end
    end

    describe "for the puppetfile path" do
      it "sets the option from the cli option if given" do
        opts = {:puppetfile => '/some/other/nonexistent/modules'}
        expect(cri_runner.handle_opts(opts)).to include(:puppetfile => '/some/other/nonexistent/modules')
      end
    end
  end
end

Version data entries

36 entries across 36 versions & 2 rubygems

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