Sha256: 94107438dc28df6286b43cc0c5e4a100b8f33c0a04e78130673210d73ec8dbab

Contents?: true

Size: 870 Bytes

Versions: 1

Compression:

Stored size: 870 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Yardstick::Config, '#set_defaults' do
  subject { described_class.new(options) }

  context 'when without options' do
    let(:options) { {} }

    its(:threshold) { should be(100) }

    its(:verbose?) { should be(true) }

    its(:path) { should eq('lib/**/*.rb') }

    its(:require_exact_threshold?) { should be(true) }

    it 'sets rules to empty hash' do
      expect(subject.instance_variable_get(:@rules)).to eq({})
    end
  end

  context 'when with options' do
    let(:options) do
      {
        threshold: 15,
        verbose: false,
        path: 'tmp/*.rb',
        require_exact_threshold: false
      }
    end

    its(:threshold) { should be(15) }

    its(:verbose?) { should be(false) }

    its(:path) { should eq('tmp/*.rb') }

    its(:require_exact_threshold?) { should be(false) }
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
yardstick-0.9.7 spec/unit/yardstick/config/set_defaults_spec.rb