Sha256: 604c1c6bc9d80e08849801155c4929df0dc59df48deb86decdea8bd877800463

Contents?: true

Size: 1.4 KB

Versions: 39

Compression:

Stored size: 1.4 KB

Contents

describe Knapsack::Config::Tracker do
  describe '.enable_time_offset_warning' do
    subject { described_class.enable_time_offset_warning }
    it { should be true }
  end

  describe '.time_offset_in_seconds' do
    subject { described_class.time_offset_in_seconds }
    it { should eql 30 }
  end

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

    context 'when ENV exists' do
      it 'should be true when KNAPSACK_GENERATE_REPORT=true' do
        with_env 'KNAPSACK_GENERATE_REPORT' => 'true' do
          expect(subject).to eq(true)
        end
      end

      it 'should be true when KNAPSACK_GENERATE_REPORT=0' do
        with_env 'KNAPSACK_GENERATE_REPORT' => '0' do
          expect(subject).to eq(true)
        end
      end

      it 'should be false when KNAPSACK_GENERATE_REPORT is ""' do
        with_env 'KNAPSACK_GENERATE_REPORT' => '' do
          expect(subject).to eq(false)
        end
      end

      it 'should be false when KNAPSACK_GENERATE_REPORT is "false"' do
        with_env 'KNAPSACK_GENERATE_REPORT' => 'false' do
          expect(subject).to eq(false)
        end
      end

      it 'should be false when KNAPSACK_GENERATE_REPORT is not "true" or "0"' do
        with_env 'KNAPSACK_GENERATE_REPORT' => '1' do
          expect(subject).to eq(false)
        end
      end
    end

    context "when ENV doesn't exist" do
      it { should be false }
    end
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
knapsack-4.0.0 spec/knapsack/config/tracker_spec.rb
knapsack-3.1.0 spec/knapsack/config/tracker_spec.rb
knapsack-3.0.0 spec/knapsack/config/tracker_spec.rb
knapsack-2.0.0 spec/knapsack/config/tracker_spec.rb
knapsack-1.22.0 spec/knapsack/config/tracker_spec.rb
knapsack-1.21.1 spec/knapsack/config/tracker_spec.rb
knapsack-1.21.0 spec/knapsack/config/tracker_spec.rb
knapsack-1.20.0 spec/knapsack/config/tracker_spec.rb
knapsack-1.19.0 spec/knapsack/config/tracker_spec.rb
knapsack-1.18.0 spec/knapsack/config/tracker_spec.rb
knapsack-1.17.2 spec/knapsack/config/tracker_spec.rb
knapsack-1.17.1 spec/knapsack/config/tracker_spec.rb
knapsack-1.17.0 spec/knapsack/config/tracker_spec.rb
knapsack-1.16.0 spec/knapsack/config/tracker_spec.rb
knapsack-1.15.0 spec/knapsack/config/tracker_spec.rb
knapsack-1.14.1 spec/knapsack/config/tracker_spec.rb
knapsack-1.14.0 spec/knapsack/config/tracker_spec.rb
knapsack-1.13.3 spec/knapsack/config/tracker_spec.rb
knapsack-1.13.2 spec/knapsack/config/tracker_spec.rb
knapsack-1.13.1 spec/knapsack/config/tracker_spec.rb