• Stars
    star
    103
  • Rank 333,046 (Top 7 %)
  • Language
    Objective-C
  • License
    MIT License
  • Created about 9 years ago
  • Updated over 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Detects when your Xcode tests are being run in a CI server, and makes them pass🙈

Volkswagen for Xcode

Build Status

CocoaPods Compatible Carthage Compatible Platform

Twitter Weibo

Volkswagen for Xcode makes failing test cases pass in CI servers.

This project is inspired by volkswagen for javascript, and phpunit-vw for PHP.

Example

Tests like these will pass.

Swift

import XCTest

class SwiftVolkswagenTests: XCTestCase {
  
  func testAssertTrue() {
    XCTAssertTrue(false);
  }
  
  func testAssertEqual () {
    XCTAssertEqual(1, 2);
  }
}

Objective C

#import <XCTest/XCTest.h>

@interface VolkswagenTests : XCTestCase

@end

@implementation VolkswagenTests

- (void)testAssertEqualObjects {
  XCTAssertEqualObjects(nil, [NSString new]);
}

- (void)testAssertNotNil {
  XCTAssertNotNil(nil);
}

@end

Requirements

Use CocoaPods or Carthage

  • iOS 8.0+ / Mac OS X 10.9+
  • Xcode 7.0

Pure Objective-C projects using CocoaPods should have lower requirements since they don't have to use_frameworks!.

Manually include the source

  • I have tested this yet, but this should work with almost all versions of OS in recent years

Currently using Volkswagen-Xcode on iOS/tvOS only supports Travis CI. More CI environment detection is yet to come. Keep an eye on this issue.

Installation

CocoaPods

You can use CocoaPods to install Volkswagen-Xcode by adding it to your to your Podfile:

platform :osx, '10.9'
use_frameworks!

target 'MyTestTarget' do
	pod 'Volkswagen', '~> 0.2.0'
end

Then, run the following command:

$ pod install

Carthage

Adding the following line to your Cartfile.private:

github "cezheng/Volkswagen" ~> 0.2.0

Run the following command:

$ carthage update

Then drag the Volkswagen.framework built by Carthage into your test target's Build Phases -> Link Binary With Libraries.

License

Volkswagen-Xcode is released under the MIT license. See LICENSE for details.