spec/unit/action/runner_spec.rb in r10k-2.0.3 vs spec/unit/action/runner_spec.rb in r10k-2.1.0
- old
+ new
@@ -1,19 +1,22 @@
require 'spec_helper'
+require 'r10k/action/base'
+require 'puppet_forge/connection'
+
require 'r10k/action/runner'
-
describe R10K::Action::Runner do
let(:action_class) do
Class.new do
attr_reader :opts
attr_reader :argv
- def initialize(opts, argv)
+ def initialize(opts, argv, settings = {})
@opts = opts
@argv = argv
+ @settings = {}
end
def call
@argv.map(&:upcase)
end
@@ -47,10 +50,15 @@
it "configures settings" do
expect(runner).to receive(:setup_settings)
runner.call
end
+ it "configures forge authorization" do
+ expect(runner).to receive(:setup_authorization)
+ runner.call
+ end
+
it "returns the result of the wrapped class #call method" do
expect(runner.call).to eq %w[ARGS YES]
end
end
@@ -62,16 +70,9 @@
end
it "does not modify the loglevel if :loglevel is not provided" do
expect(R10K::Logging).to_not receive(:level=)
runner.call
- end
- end
-
- describe "configuring settings" do
- it "configures authorization" do
- expect(runner).to receive(:setup_authorization)
- runner.setup_settings
end
end
describe "configuration authorization" do
context "when license is not present" do