Sha256: 712381699281a50a87d7c649cb8072d039b8d8c416b9651151666a649dbe008c

Contents?: true

Size: 1.2 KB

Versions: 22

Compression:

Stored size: 1.2 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 'Default'
      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 'color' do
      describe 'manually on' do
        let(:args) { ['--color'] }

        it 'sets the `color` option to true' do
          subject.should include color: true
        end
      end

      describe 'manually off' do
        let(:args) { ['--no-color'] }

        it 'sets the `color option to false' do
          subject.should include color: false
        end
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
scss_lint-0.60.0 spec/scss_lint/options_spec.rb
scss_lint-0.59.0 spec/scss_lint/options_spec.rb
scss_lint-0.58.0 spec/scss_lint/options_spec.rb
scss_lint-0.57.1 spec/scss_lint/options_spec.rb
scss_lint-0.57.0 spec/scss_lint/options_spec.rb
scss_lint-0.56.0 spec/scss_lint/options_spec.rb
scss_lint-0.55.0 spec/scss_lint/options_spec.rb
scss_lint-0.54.0 spec/scss_lint/options_spec.rb
scss_lint-0.53.0 spec/scss_lint/options_spec.rb
scss_lint-0.52.0 spec/scss_lint/options_spec.rb
scss_lint-0.51.0 spec/scss_lint/options_spec.rb
scss_lint-0.50.3 spec/scss_lint/options_spec.rb
scss_lint-0.50.2 spec/scss_lint/options_spec.rb
scss_lint-0.50.1 spec/scss_lint/options_spec.rb
scss_lint-0.50.0 spec/scss_lint/options_spec.rb
scss_lint-0.49.0 spec/scss_lint/options_spec.rb
scss_lint-0.48.0 spec/scss_lint/options_spec.rb
scss_lint-0.47.1 spec/scss_lint/options_spec.rb
scss_lint-0.47.0 spec/scss_lint/options_spec.rb
scss_lint-0.46.0 spec/scss_lint/options_spec.rb