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.60.0 spec/scss_lint/location_spec.rb
scss_lint-0.59.0 spec/scss_lint/location_spec.rb
scss_lint-0.58.0 spec/scss_lint/location_spec.rb
scss_lint-0.57.1 spec/scss_lint/location_spec.rb
scss_lint-0.57.0 spec/scss_lint/location_spec.rb
scss_lint-0.56.0 spec/scss_lint/location_spec.rb
scss_lint-0.55.0 spec/scss_lint/location_spec.rb
scss_lint-0.54.0 spec/scss_lint/location_spec.rb
scss_lint-0.53.0 spec/scss_lint/location_spec.rb
scss_lint-0.52.0 spec/scss_lint/location_spec.rb
scss_lint-0.51.0 spec/scss_lint/location_spec.rb
scss_lint-0.50.3 spec/scss_lint/location_spec.rb
scss_lint-0.50.2 spec/scss_lint/location_spec.rb
scss_lint-0.50.1 spec/scss_lint/location_spec.rb
scss_lint-0.50.0 spec/scss_lint/location_spec.rb
scss_lint-0.49.0 spec/scss_lint/location_spec.rb
scss_lint-0.48.0 spec/scss_lint/location_spec.rb
scss_lint-0.47.1 spec/scss_lint/location_spec.rb
scss_lint-0.47.0 spec/scss_lint/location_spec.rb
scss_lint-0.46.0 spec/scss_lint/location_spec.rb