<commit_before>import XCTest
import Nimble
@testable import GestureRecognizerClosures

class UIBarButtonItemClosuresTests: XCTestCase {

    var expectation: Bool!

    override func setUp() {
        super.setUp()
        expectation = false
    }

    func test_initWithImageAndStyleAndClosure() {
        let image = UIImage()
        let style =  UIBarButtonItemStyle.Plain
        let barButtonItem = UIBarButtonItem(image: image, style: style) { barButtonItem in
            self.expectation = true
        }

        expect(barButtonItem.image).to(equal(image))
        expect(barButtonItem.style).to(equal(style))
        testHandler(barButtonItem)
    }

    func test_initWithImageLandscapeImagePhoneStyleAndClosure() {
        let image = UIImage()<commit_msg>Add UIBarButtonItem handler property test<commit_after>import XCTest
import Nimble
@testable import GestureRecognizerClosures

class UIBarButtonItemClosuresTests: XCTestCase {

    var expectation: Bool!

    override func setUp() {
        super.setUp()
        expectation = false
    }

    func test_handlerProperty() {
        let image = UIImage()
        let style =  UIBarButtonItemStyle.Plain
        let barButtonItem = UIBarButtonItem(image: image, style: style)
        expect(barButtonItem.target).to(beNil())
        expect(barButtonItem.handler).to(beNil())

        barButtonItem.handler = { barButtonItem in
            self.expectation = true
        }

        testHandler(barButtonItem)
    }

    func test_initWithImageAndStyleAndClosure() {
        let image = UIImage()
        let style =  UIBarButtonItemStyle.Plain
        let barButtonItem = UIBarButtonItem(image: image, style: style) { barButtonItem in
            self.expectation = true
        }

        expect(barButtonItem.image).to(equal(image))
        expect(barButtonItem.style).to(equal(style))
        testHandler(barButtonItem)
    }

    func test_initWithImageLandscapeImagePhoneStyleAndClosure() {
        let image = UIImage()
{'fraction_non_alphanumeric': 0.07873620862587763, 'fraction_numerical': 0.0, 'mean_word_length': 2.93491124260355, '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': '5012145', 'n_tokens_mistral': 584, 'n_tokens_neox': 567, 'n_words': 115}