Sha256: 40bf5e9efd40364dd6b9a329b63fae1c185edb9a2cd4d4924f12cd489796d689

Contents?: true

Size: 1.16 KB

Versions: 50

Compression:

Stored size: 1.16 KB

Contents

require 'spec_helper'

describe SCSSLint::Location do
  let(:engine) { described_class.new(css) }

  describe '#<=>' do
    let(:locations) do
      [
        SCSSLint::Location.new(2, 2, 2),
        SCSSLint::Location.new(2, 2, 1),
        SCSSLint::Location.new(2, 1, 2),
        SCSSLint::Location.new(2, 1, 1),
        SCSSLint::Location.new(1, 2, 2),
        SCSSLint::Location.new(1, 2, 1),
        SCSSLint::Location.new(1, 1, 2),
        SCSSLint::Location.new(1, 1, 1)
      ]
    end

    it 'allows locations to be sorted' do
      locations.sort.should == [
        SCSSLint::Location.new(1, 1, 1),
        SCSSLint::Location.new(1, 1, 2),
        SCSSLint::Location.new(1, 2, 1),
        SCSSLint::Location.new(1, 2, 2),
        SCSSLint::Location.new(2, 1, 1),
        SCSSLint::Location.new(2, 1, 2),
        SCSSLint::Location.new(2, 2, 1),
        SCSSLint::Location.new(2, 2, 2)
      ]
    end

    context 'when the same location is passed' do
      let(:location) { SCSSLint::Location.new(1, 1, 1) }
      let(:other_location) { SCSSLint::Location.new(1, 1, 1) }

      it 'returns 0' do
        (location <=> other_location).should == 0
      end
    end
  end
end

Version data entries

50 entries across 50 versions & 3 rubygems

Version Path
scss-lint-0.33.0 spec/scss_lint/location_spec.rb
scss-lint-0.32.0 spec/scss_lint/location_spec.rb
scss-lint-0.31.0 spec/scss_lint/location_spec.rb
scss-lint-0.30.0 spec/scss_lint/location_spec.rb
scss-lint-0.29.0 spec/scss_lint/location_spec.rb
scss-lint-0.28.0 spec/scss_lint/location_spec.rb
scss-lint-0.27.0 spec/scss_lint/location_spec.rb
scss-lint-0.26.2 spec/scss_lint/location_spec.rb
scss-lint-0.26.1 spec/scss_lint/location_spec.rb
scss-lint-0.26.0 spec/scss_lint/location_spec.rb