<commit_before>#if TARGET_OS_IPHONE
// Normally you would include this file out of the framework.  However, we're
// testing the framework here, so including the file from the framework will
// conflict with the compiler attempting to include the file from the project.
#import "SpecHelper.h"
#import "OCMock.h"
#else
#import <Cedar/SpecHelper.h>
#import <OCMock/OCMock.h>
#endif

#import "CDRExample.h"
#import "CDRJUnitXMLReporter.h"
#import "CDRSpecFailure.h"

using namespace Cedar::Matchers;

// Test class overrides actually writing XML to a file for speed and easier assertions
@interface TestCDRJUnitXMLReporter : CDRJUnitXMLReporter {
@private
    NSString *xml_;
}

@property (nonatomic, copy) NSString *xml;
@end

@implementation TestCDRJUnitXMLReporter

@synthesize xml = xml_;

- (void)dealloc {
    self.xml = nil;
}

- (void)writeXmlToFile:(NSString *)xmlString {
    self.xml = xmlString;
}

@end

// Allow setting state for testing purposes
@implementation CDRExample (Spec)

- (void)setState:(CDRExampleState)state {
    state_ = state;
}

+ (id) exampleWithText:(NSString *)text andState:(CDRExampleState)state {
    CDRExample *example = [CDRExample exampleWithText:text andBlock:^{}];
    [example setState:state];
    return example;
}

@end


SPEC_BEGIN(CDRJUnitXMLReporterSpec)

describe(@"runDidComplete", ^{
    __block TestCDRJUnitXMLReporter *reporter;<commit_msg>Added missing [super dealloc] to fix clang compiler error<commit_after>#if TARGET_OS_IPHONE
// Normally you would include this file out of the framework.  However, we're
// testing the framework here, so including the file from the framework will
// conflict with the compiler attempting to include the file from the project.
#import "SpecHelper.h"
#import "OCMock.h"
#else
#import <Cedar/SpecHelper.h>
#import <OCMock/OCMock.h>
#endif

#import "CDRExample.h"
#import "CDRJUnitXMLReporter.h"
#import "CDRSpecFailure.h"

using namespace Cedar::Matchers;

// Test class overrides actually writing XML to a file for speed and easier assertions
@interface TestCDRJUnitXMLReporter : CDRJUnitXMLReporter {
@private
    NSString *xml_;
}

@property (nonatomic, copy) NSString *xml;
@end

@implementation TestCDRJUnitXMLReporter

@synthesize xml = xml_;

- (void)dealloc {
    self.xml = nil;
    [super dealloc];
}

- (void)writeXmlToFile:(NSString *)xmlString {
    self.xml = xmlString;
}

@end

// Allow setting state for testing purposes
@implementation CDRExample (Spec)

- (void)setState:(CDRExampleState)state {
    state_ = state;
}

+ (id) exampleWithText:(NSString *)text andState:(CDRExampleState)state {
    CDRExample *example = [CDRExample exampleWithText:text andBlock:^{}];
    [example setState:state];
    return example;
}

@end


SPEC_BEGIN(CDRJUnitXMLReporterSpec)

describe(@"runDidComplete", ^{
    __block TestCDRJUnitXMLReporter *reporter;
{'fraction_non_alphanumeric': 0.10354510354510355, 'fraction_numerical': 0.0, 'mean_word_length': 5.076759061833688, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 16}, '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': '947458', 'n_tokens_mistral': 966, 'n_tokens_neox': 908, 'n_words': 263}