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.45.0 spec/scss_lint/location_spec.rb
scss_lint-0.44.0 spec/scss_lint/location_spec.rb
scss_lint-0.43.2 spec/scss_lint/location_spec.rb
scss_lint-0.43.1 spec/scss_lint/location_spec.rb
scss_lint-0.43.0 spec/scss_lint/location_spec.rb
scss_lint-0.42.2 spec/scss_lint/location_spec.rb
scss_lint-0.42.1 spec/scss_lint/location_spec.rb
scss_lint-0.42.0 spec/scss_lint/location_spec.rb
scss_lint-0.41.0 spec/scss_lint/location_spec.rb
scss_lint-0.40.1 spec/scss_lint/location_spec.rb
scss_lint-0.40.0 spec/scss_lint/location_spec.rb
scss_lint-0.39.0 spec/scss_lint/location_spec.rb
scss_lint-0.38.0 spec/scss_lint/location_spec.rb
scss-lint-0.38.0 spec/scss_lint/location_spec.rb
scss-lint-bliss-1.0.0 spec/scss_lint/location_spec.rb
scss-lint-0.37.0 spec/scss_lint/location_spec.rb
scss-lint-0.36.1 spec/scss_lint/location_spec.rb
scss-lint-0.36.0 spec/scss_lint/location_spec.rb
scss-lint-0.35.0 spec/scss_lint/location_spec.rb
scss-lint-0.34.0 spec/scss_lint/location_spec.rb