<commit_before>//
//  STReachabilityOSXSpec.swift
//  SwiftlyReachable
//
//  Created by <NAME> on 2/16/15.
//  Copyright (c) 2015 SwiftTime. All rights reserved.
//

import Cocoa
import Quick
import Nimble

public var statusFlags:UInt32 = 0

class STReachabilityOSXSpec: QuickSpec {

    override func spec() {
        let FLAGS_FOR_UNREACHABLE:UInt32 = 0b0
        let FLAGS_FOR_WIFI:UInt32        = 0b10
        let FLAGS_FOR_CELL:UInt32        = 0b1000000000000000011

        let STATUS_UNREACHABLE = STReachability.Status.UnReachable
        let STATUS_WIFI        = STReachability.Status.ViaWiFi
        let STATUS_CELL        = STReachability.Status.ViaCellData

        var reachability:STReachability!
        
        beforeEach {
            reachability = STReachability()
        }
        
        describe("STReachability") {
            context("when background updates are started") {
                it("should start updating status in the background") {
                    statusFlags = FLAGS_FOR_WIFI
                    var blockStatus:STReachability.Status = .Unknown
                    reachability.changedBlock = {status
                        in
                        blockStatus = status
                    }
                    reachability.startMonitor()
                    expect(blockStatus).toEventually(equal(STATUS_WIFI), timeout: 3, pollInterval: 0.5)
                }<commit_msg>still tinkering with the wording<commit_after>//
//  STReachabilityOSXSpec.swift
//  SwiftlyReachable
//
//  Created by <NAME> on 2/16/15.
//  Copyright (c) 2015 SwiftTime. All rights reserved.
//

import Cocoa
import Quick
import Nimble

public var statusFlags:UInt32 = 0

class STReachabilityOSXSpec: QuickSpec {

    override func spec() {
        let FLAGS_FOR_UNREACHABLE:UInt32 = 0b0
        let FLAGS_FOR_WIFI:UInt32        = 0b10
        let FLAGS_FOR_CELL:UInt32        = 0b1000000000000000011

        let STATUS_UNREACHABLE = STReachability.Status.UnReachable
        let STATUS_WIFI        = STReachability.Status.ViaWiFi
        let STATUS_CELL        = STReachability.Status.ViaCellData

        var reachability:STReachability!
        
        beforeEach {
            reachability = STReachability()
        }
        
        describe("STReachability") {
            context("when background updates are started") {
                it("should execute the block when the status changes") {
                    statusFlags = FLAGS_FOR_WIFI
                    var blockStatus:STReachability.Status = .Unknown
                    reachability.changedBlock = {status
                        in
                        blockStatus = status
                    }
                    reachability.startMonitor()
                    expect(blockStatus).toEventually(equal(STATUS_WIFI), timeout: 3, pollInterval: 0.5)
                }
{'fraction_non_alphanumeric': 0.06766655040111615, 'fraction_numerical': 0.032089291942797346, 'mean_word_length': 1.8228346456692914, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '3133626', 'n_tokens_mistral': 892, 'n_tokens_neox': 782, 'n_words': 171}