<commit_before>import Quick
import Nimble
import CoreLocation
import XCGLogger


class StopTests: QuickSpec {
  
//  override func setUp() {
//    super.setUp()
//    setUpLog()
//  }
  override func spec() {
    beforeSuite {
      setUpLog()
    }

    describe("a new stop") {
      var stop: Stop!
      
      describe("to be created using mandatory parameters") {

        beforeEach {
          stop = Stop(id: "id", name: "name")
        }
        
        it("with id") {
          expect(stop.id).to(equal("id"))
        }

        it("with name") {
          expect(stop.name).to(equal("name"))
        }

        it("without valid latitude") {
          expect(stop.latitude).to(equal(0.0))
        }
        
        it("without valid longitude") {
          expect(stop.longitude).to(equal(0.0))
        }
      }

      describe("to be created using location") {

        beforeEach {
          stop = Stop(id: "id", name: "name", location: CLLocation(latitude: 10, longitude: 20))
        }
        
        it("with coordinate with latitude") {
          expect(stop.location.coordinate.latitude).to(equal(10))
        }
        it("with coordinate with longitude") {
          expect(stop.location.coordinate.longitude).to(equal(20))
        }
      }
    
      describe("is distance from a location") {
        var stop: Stop!
        beforeEach {
          stop = Stop(id: "id", name: "name", location: CLLocation(latitude: -23, longitude: 61))
        }
        
        it("of 0 meters") {
          let sameLocation = CLLocation(latitude: -23, longitude: 61)
          expect(stop.distanceFromUserLocation(sameLocation)).to(equal(NSLocalizedString("exactly in your location", comment: "")))
        }
        
        it("of x meters") {
          let differentLocation = CLLocation(latitude: -23, longitude: 62)
          expect(stop.distanceFromUserLocation(differentLocation)).to(contain("from your location"))
        }<commit_msg>Update test for stop distance check.<commit_after>import Quick
import Nimble
import CoreLocation
import XCGLogger


class StopTests: QuickSpec {
  
//  override func setUp() {
//    super.setUp()
//    setUpLog()
//  }
  override func spec() {
    beforeSuite {
      setUpLog()
    }

    describe("a new stop") {
      var stop: Stop!
      
      describe("to be created using mandatory parameters") {

        beforeEach {
          stop = Stop(id: "id", name: "name")
        }
        
        it("with id") {
          expect(stop.id).to(equal("id"))
        }

        it("with name") {
          expect(stop.name).to(equal("name"))
        }

        it("without valid latitude") {
          expect(stop.latitude).to(equal(0.0))
        }
        
        it("without valid longitude") {
          expect(stop.longitude).to(equal(0.0))
        }
      }

      describe("to be created using location") {

        beforeEach {
          stop = Stop(id: "id", name: "name", location: CLLocation(latitude: 10, longitude: 20))
        }
        
        it("with coordinate with latitude") {
          expect(stop.location.coordinate.latitude).to(equal(10))
        }
        it("with coordinate with longitude") {
          expect(stop.location.coordinate.longitude).to(equal(20))
        }
      }
    
      describe("is distance from a location") {
        var stop: Stop!
        beforeEach {
          stop = Stop(id: "id", name: "name", location: CLLocation(latitude: -23, longitude: 61))
        }
        
        it("of 0 meters") {
          let sameLocation = CLLocation(latitude: -23, longitude: 61)
          expect(stop.distanceFromUserLocation(sameLocation)).to(equal(NSLocalizedString("Exactly at your location", comment: "")))
        }
        
        it("of x meters") {
          let differentLocation = CLLocation(latitude: -23, longitude: 62)
          expect(stop.distanceFromUserLocation(differentLocation)).to(contain("from your location"))
        }
{'fraction_non_alphanumeric': 0.13017000761228115, 'fraction_numerical': 0.01268713524486171, 'mean_word_length': 2.0299769408147577, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5496882', 'n_tokens_mistral': 1180, 'n_tokens_neox': 1117, 'n_words': 253}