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