Sha256: dfaa371f3863d00c39fc894ab40d7fa906f295187162171c73fb28029f843b30

Contents?: true

Size: 1.07 KB

Versions: 1

Compression:

Stored size: 1.07 KB

Contents

require 'spec_helper'
require 'scss_lint/options'

describe SCSSLint::Options do
  describe '#parse' do
    subject { super().parse(args) }

    context 'when no arguments are specified' do
      let(:args) { [] }

      it { should be_a Hash }

      it 'defines no files to lint by default' do
        subject[:files].should be_empty
      end

      it 'specifies the DefaultReporter by default' do
        subject[:reporters].first.should include SCSSLint::Reporter::DefaultReporter
      end

      it 'outputs to STDOUT' do
        subject[:reporters].first.should include :stdout
      end
    end

    context 'when a non-existent flag is specified' do
      let(:args) { ['--totally-made-up-flag'] }

      it 'raises an error' do
        expect { subject }.to raise_error SCSSLint::Exceptions::InvalidCLIOption
      end
    end

    context 'when a non-existent reporter is specified' do
      let(:args) { %w[--format NonExistentReporter] }

      it 'raises an error' do
        expect { subject }.to raise_error SCSSLint::Exceptions::InvalidCLIOption
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
scss-lint-0.31.0 spec/scss_lint/options_spec.rb