Sha256: 9182fc5e2054bd78bd7f131fc51f9ec34520297607be4fec479c4ad099f654a0

Contents?: true

Size: 1.24 KB

Versions: 16

Compression:

Stored size: 1.24 KB

Contents

require "spec_helper"

module LicenseFinder
  module CLI
    describe IgnoredDependencies do
      let(:decisions) { Decisions.new }

      before do
        allow(Decisions).to receive(:fetch_saved) { decisions }
      end

      describe "list" do
        context "when there is at least one ignored dependency" do
          it "shows the ignored dependencies" do
            decisions.ignore("bundler")
            expect(capture_stdout { subject.list }).to match /bundler/
          end
        end

        context "when there are no ignored dependencies" do
          it "prints '(none)'" do
            expect(capture_stdout { subject.list }).to match /\(none\)/
          end
        end
      end

      describe "add" do
        it "adds the specified group to the ignored groups list" do
          silence_stdout do
            subject.add("test")
          end
          expect(subject.decisions.ignored).to eq ["test"].to_set
        end
      end

      describe "remove" do
        it "removes the specified group from the ignored groups list" do
          silence_stdout do
            subject.add("test")
            subject.remove("test")
          end
          expect(subject.decisions.ignored).to be_empty
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
license_finder-3.0.4 spec/lib/license_finder/cli/ignored_dependencies_spec.rb
license_finder-3.0.2 spec/lib/license_finder/cli/ignored_dependencies_spec.rb
license_finder-3.0.1 spec/lib/license_finder/cli/ignored_dependencies_spec.rb
license_finder-3.0.0 spec/lib/license_finder/cli/ignored_dependencies_spec.rb
license_finder-2.1.2 spec/lib/license_finder/cli/ignored_dependencies_spec.rb
license_finder-2.1.1 spec/lib/license_finder/cli/ignored_dependencies_spec.rb
license_finder-2.1.0 spec/lib/license_finder/cli/ignored_dependencies_spec.rb
license_finder-2.1.0.rc9 spec/lib/license_finder/cli/ignored_dependencies_spec.rb
license_finder-2.1.0.rc8 spec/lib/license_finder/cli/ignored_dependencies_spec.rb
license_finder-2.1.0.rc7 spec/lib/license_finder/cli/ignored_dependencies_spec.rb
license_finder-2.1.0.rc6 spec/lib/license_finder/cli/ignored_dependencies_spec.rb
license_finder-2.1.0.rc5 spec/lib/license_finder/cli/ignored_dependencies_spec.rb
license_finder-2.1.0.rc4 spec/lib/license_finder/cli/ignored_dependencies_spec.rb
license_finder-2.1.0.rc3 spec/lib/license_finder/cli/ignored_dependencies_spec.rb
license_finder-2.1.0.rc2 spec/lib/license_finder/cli/ignored_dependencies_spec.rb
license_finder-2.1.0.rc1 spec/lib/license_finder/cli/ignored_dependencies_spec.rb