require 'spec_helper'

describe SCSSLint::Linter::Compass::PropertyWithMixin do
  context 'when a rule has a property with an equivalent Compass mixin' do
    let(:css) { <<-CSS }
      p {
        opacity: .5;
      }
    CSS

    it { should report_lint line: 2 }
  end

  context 'when a rule includes a Compass property mixin' do
    let(:css) { <<-CSS }
      p {
        @include opacity(.5);
      }
    CSS

    it { should_not report_lint }
  end

  context 'when a rule does not have a property with a corresponding Compass mixin' do
    let(:css) { <<-CSS }
      p {
        margin: 0;
      }
    CSS

    it { should_not report_lint }
  end

  context 'when a rule includes display: inline-block' do
    let(:css) { <<-CSS }
      p {
        display: inline-block;
      }
    CSS

    it { should report_lint line: 2 }
  end
end

require 'spec_helper'

describe SCSSLint::Linter::Compass::PropertyWithMixin do
  context 'when a rule has a property with an equivalent Compass mixin' do
    let(:css) { <<-CSS }
      p {
        opacity: .5;
      }
    CSS

    it { should report_lint line: 2 }
  end

  context 'when a rule includes a Compass property mixin' do
    let(:css) { <<-CSS }
      p {
        @include opacity(.5);
      }
    CSS

    it { should_not report_lint }
  end

  context 'when a rule does not have a property with a corresponding Compass mixin' do
    let(:css) { <<-CSS }
      p {
        margin: 0;
      }
    CSS

    it { should_not report_lint }
  end

  context 'when a rule includes display: inline-block' do
    let(:css) { <<-CSS }
      p {
        display: inline-block;
      }
    CSS

    it { should report_lint line: 2 }
  end

  context 'when properties are ignored' do
    let(:linter_config) { { 'ignore' => %w[inline-block] } }

    let(:css) { <<-CSS }
      p {
        display: inline-block;
      }
    CSS

    it { should_not report_lint }
  end
end

Add spec for new PropertyWithMixin ignore option
Add spec for new PropertyWithMixin ignore option

Change-Id: Ifc7d552844e8bdc9c117c2719b53ef9f76d6bb40
Reviewed-on: http://gerrit.causes.com/40956
Tested-by: jenkins <d95b56ce41a2e1ac4cecdd398defd7414407cc08@causes.com>
Reviewed-by: Shane da Silva <67fb7bfe39f841b16a1f86d3928acc568d12c716@brigade.com>
