Sha256: bdde2c09800289c2fa082d6b153b84b849b77b97568f8c37a39804574ab680d5

Contents?: true

Size: 1.47 KB

Versions: 24

Compression:

Stored size: 1.47 KB

Contents

describe KnapsackPro do
  describe '.root' do
    subject { described_class.root }

    it { expect(subject).to match 'knapsack' }
  end

  describe '.logger' do
    let(:logger_wrapper) { double }

    subject { described_class.logger }

    before { described_class.reset_logger! }
    after { described_class.reset_logger! }

    context 'when default logger' do
      let(:logger) { instance_double(Logger) }

      before do
        expect(Logger).to receive(:new).with(STDOUT).and_return(logger)
        expect(logger).to receive(:level=).with(Logger::DEBUG)
        expect(KnapsackPro::LoggerWrapper).to receive(:new).with(logger).and_return(logger_wrapper)
      end

      it { should eql logger_wrapper }
    end

    context 'when custom logger' do
      let(:logger) { double('custom logger') }

      before do
        expect(KnapsackPro::LoggerWrapper).to receive(:new).with(logger).and_return(logger_wrapper)
        described_class.logger = logger
      end

      it { should eql logger_wrapper }
    end
  end

  describe '.tracker' do
    subject { described_class.tracker }

    it { should be_a KnapsackPro::Tracker }
    it { expect(subject.object_id).to eql described_class.tracker.object_id }
  end

  describe '.load_tasks' do
    let(:task_loader) { instance_double(KnapsackPro::TaskLoader) }

    it do
      expect(KnapsackPro::TaskLoader).to receive(:new).and_return(task_loader)
      expect(task_loader).to receive(:load_tasks)
      described_class.load_tasks
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
knapsack_pro-0.53.0 spec/knapsack_pro_spec.rb
knapsack_pro-0.52.0 spec/knapsack_pro_spec.rb
knapsack_pro-0.51.0 spec/knapsack_pro_spec.rb
knapsack_pro-0.50.1 spec/knapsack_pro_spec.rb
knapsack_pro-0.50.0 spec/knapsack_pro_spec.rb
knapsack_pro-0.49.0 spec/knapsack_pro_spec.rb
knapsack_pro-0.48.0 spec/knapsack_pro_spec.rb
knapsack_pro-0.47.0 spec/knapsack_pro_spec.rb
knapsack_pro-0.46.0 spec/knapsack_pro_spec.rb
knapsack_pro-0.45.0 spec/knapsack_pro_spec.rb
knapsack_pro-0.44.0 spec/knapsack_pro_spec.rb
knapsack_pro-0.43.0 spec/knapsack_pro_spec.rb
knapsack_pro-0.42.0 spec/knapsack_pro_spec.rb
knapsack_pro-0.41.0 spec/knapsack_pro_spec.rb
knapsack_pro-0.40.0 spec/knapsack_pro_spec.rb
knapsack_pro-0.39.0 spec/knapsack_pro_spec.rb
knapsack_pro-0.38.0 spec/knapsack_pro_spec.rb
knapsack_pro-0.37.0 spec/knapsack_pro_spec.rb
knapsack_pro-0.36.0 spec/knapsack_pro_spec.rb
knapsack_pro-0.35.0 spec/knapsack_pro_spec.rb