Sha256: dfa73960087947cde2e29eed30054fd6c9a319f7c07c82084ff5007572aa1538
Contents?: true
Size: 1.69 KB
Versions: 1
Compression:
Stored size: 1.69 KB
Contents
require "spec_helper" module LicenseFinder module CLI describe Approvals do let(:decisions) { Decisions.new } before do allow(Decisions).to receive(:saved!) { decisions } end describe "#add" do it "approves the requested gem" do silence_stdout do subject.add 'foo' end expect(subject.decisions).to be_approved "foo" end it "approves multiple dependencies" do silence_stdout do subject.add 'foo', 'bar' end expect(subject.decisions).to be_approved "foo" expect(subject.decisions).to be_approved "bar" end it "raises a warning if no dependency was specified" do silence_stdout do expect { subject.add }.to raise_error(ArgumentError) end end it "sets approver and approval message" do expect(decisions).to receive(:approve).with("foo", hash_including(who: "Julian", why: "We really need this")) silence_stdout do Main.start(["approval", "add", "--who", "Julian", "--why", "We really need this", "foo"]) end end end describe "remove" do it "unapproves the specified dependency" do silence_stdout do subject.add("test") subject.remove("test") end expect(subject.decisions).not_to be_approved "test" end it "is cumulative" do silence_stdout do subject.add("test") subject.remove("test") subject.add("test") end expect(subject.decisions).to be_approved "test" end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
license_finder-2.0.0.rc2 | spec/lib/license_finder/cli/approvals_spec.rb |