diff --git a/CHANGELOG.md b/CHANGELOG.md index eb5849e..82f8dbc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +v0.3.0 +====== +* Adds support for Xcode/Apple LLVM 5.1, which means turning off Garbage Collection support [tonyarnold] +* Raises minimum deployment targets to iOS 5.x and OS X 10.7 [tonyarnold] + + v0.2.2 ====== diff --git a/Expecta.podspec b/Expecta.podspec index dd2802f..a5450dc 100644 --- a/Expecta.podspec +++ b/Expecta.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'Expecta' - s.version = '0.2.4' + s.version = '0.3.0' s.license = { :type => 'MIT', :file => 'LICENSE' } s.summary = 'A matcher framework for Objective-C & Cocoa.' s.homepage = 'http://github.com/petejkim/expecta' @@ -19,8 +19,8 @@ Pod::Spec.new do |s| s.source_files = 'src/**/*.{h,m}' s.requires_arc = false - s.ios.deployment_target = '4.0' - s.osx.deployment_target = '10.6' + s.ios.deployment_target = '5.0' + s.osx.deployment_target = '10.7' s.frameworks = 'Foundation' end diff --git a/Expecta.xcodeproj/project.pbxproj b/Expecta.xcodeproj/project.pbxproj index a149e3b..6695784 100644 --- a/Expecta.xcodeproj/project.pbxproj +++ b/Expecta.xcodeproj/project.pbxproj @@ -1263,7 +1263,7 @@ DSTROOT = /tmp/Expecta_iOS.dst; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "src/Expecta-Prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 4.0; + IPHONEOS_DEPLOYMENT_TARGET = 5.0; PRIVATE_HEADERS_FOLDER_PATH = ""; PRODUCT_NAME = "$(TARGET_NAME)"; PUBLIC_HEADERS_FOLDER_PATH = ""; @@ -1281,7 +1281,7 @@ DSTROOT = /tmp/Expecta_iOS.dst; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "src/Expecta-Prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 4.0; + IPHONEOS_DEPLOYMENT_TARGET = 5.0; PRIVATE_HEADERS_FOLDER_PATH = ""; PRODUCT_NAME = "$(TARGET_NAME)"; PUBLIC_HEADERS_FOLDER_PATH = ""; @@ -1361,7 +1361,7 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.6; + MACOSX_DEPLOYMENT_TARGET = 10.7; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; }; @@ -1381,7 +1381,7 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.6; + MACOSX_DEPLOYMENT_TARGET = 10.7; SDKROOT = macosx; }; name = Release; @@ -1392,7 +1392,6 @@ ALWAYS_SEARCH_USER_PATHS = NO; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; - GCC_ENABLE_OBJC_GC = supported; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "src/Expecta-Prefix.pch"; PRIVATE_HEADERS_FOLDER_PATH = ""; @@ -1407,7 +1406,6 @@ ALWAYS_SEARCH_USER_PATHS = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_ENABLE_OBJC_EXCEPTIONS = YES; - GCC_ENABLE_OBJC_GC = supported; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "src/Expecta-Prefix.pch"; PRIVATE_HEADERS_FOLDER_PATH = ""; diff --git a/README.md b/README.md index ce96620..6f419c2 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,12 @@ -# Expecta +#Expecta A Matcher Framework for Objective-C/Cocoa ## NOTICE -Expecta 0.2.x has a new syntax that is slightly different from Expecta 0.1.x. For example `expect(x).toEqual(y)` should now be written as `expect(x).to.equal(y)`. You can do `#define EXP_OLD_SYNTAX` before importing `Expecta.h` to enable backward-compatiblity mode, but keep in mind that the old syntax is deprecated. +Expecta 0.3.x removes support for Garbage Collected targets, as support for these has been removed from Xcode 5.1 and greater. If you need Garbage Collection support, please continue to use Expecta 0.2.4. The minimum deployment targets have also been raised to iOS 5.x and OS X 10.7 or greater. + +Expecta 0.2.x and later has a new syntax that is slightly different from Expecta 0.1.x. For example `expect(x).toEqual(y)` should now be written as `expect(x).to.equal(y)`. You can do `#define EXP_OLD_SYNTAX` before importing `Expecta.h` to enable backward-compatiblity mode, but keep in mind that the old syntax is deprecated. ## INTRODUCTION @@ -17,14 +19,11 @@ assertThat(@"foo", is(equalTo(@"foo"))); assertThatUnsignedInteger(foo, isNot(equalToUnsignedInteger(1))); assertThatBool([bar isBar], is(equalToBool(YES))); assertThatDouble(baz, is(equalToDouble(3.14159))); -``` - -vs. +``` vs. **Expecta ** -**Expecta** - -```objective-c -expect(@"foo").to.equal(@"foo"); // `to` is a syntatic sugar and can be safely omitted. +```objective - + c expect(@"foo").to.equal( + @"foo"); // `to` is a syntatic sugar and can be safely omitted. expect(foo).notTo.equal(1); expect([bar isBar]).to.equal(YES); expect(baz).to.equal(3.14159); @@ -36,12 +35,12 @@ Use [CocoaPods](https://github.com/CocoaPods/CocoaPods) ```ruby target :MyApp do - # your app dependencies +#your app dependencies end target :MyAppTests do pod 'Expecta', '~> 0.2.4' # expecta matchers - # pod 'Specta', '~> 0.1.11' # specta bdd framework +#pod 'Specta', '~> 0.1.11' #specta bdd framework end ``` @@ -150,7 +149,8 @@ Writing a new matcher is easy with special macros provided by Expecta. Take a lo EXPMatcherInterface(beKindOf, (Class expected)); // 1st argument is the name of the matcher function -// 2nd argument is the list of arguments that may be passed in the function call. +// 2nd argument is the list of arguments that may be passed in the function +// call. // Multiple arguments are fine. (e.g. (int foo, float bar)) #define beAKindOf beKindOf @@ -165,33 +165,40 @@ EXPMatcherImplementationBegin(beKindOf, (Class expected)) { BOOL actualIsNil = (actual == nil); BOOL expectedIsNil = (expected == nil); - prerequisite(^BOOL{ + prerequisite(^BOOL { return !(actualIsNil || expectedIsNil); - // Return `NO` if matcher should fail whether or not the result is inverted using `.Not`. + // Return `NO` if matcher should fail whether or not the result is inverted + // using `.Not`. }); - match(^BOOL{ + match(^BOOL { return [actual isKindOfClass:expected]; // Return `YES` if the matcher should pass, `NO` if it should not. // The actual value/object is passed as `actual`. // Please note that primitive values will be wrapped in NSNumber/NSValue. }); - failureMessageForTo(^NSString *{ - if(actualIsNil) return @"the actual value is nil/null"; - if(expectedIsNil) return @"the expected value is nil/null"; - return [NSString stringWithFormat:@"expected: a kind of %@, " - "got: an instance of %@, which is not a kind of %@", - [expected class], [actual class], [expected class]]; + failureMessageForTo(^NSString * { + if (actualIsNil) + return @"the actual value is nil/null"; + if (expectedIsNil) + return @"the expected value is nil/null"; + return [NSString + stringWithFormat:@"expected: a kind of %@, " + "got: an instance of %@, which is not a kind of %@", + [expected class], [actual class], [expected class]]; // Return the message to be displayed when the match function returns `YES`. }); - failureMessageForNotTo(^NSString *{ - if(actualIsNil) return @"the actual value is nil/null"; - if(expectedIsNil) return @"the expected value is nil/null"; - return [NSString stringWithFormat:@"expected: not a kind of %@, " - "got: an instance of %@, which is a kind of %@", - [expected class], [actual class], [expected class]]; + failureMessageForNotTo(^NSString * { + if (actualIsNil) + return @"the actual value is nil/null"; + if (expectedIsNil) + return @"the expected value is nil/null"; + return [NSString + stringWithFormat:@"expected: not a kind of %@, " + "got: an instance of %@, which is a kind of %@", + [expected class], [actual class], [expected class]]; // Return the message to be displayed when the match function returns `NO`. }); }