Skip to content

Commit

Permalink
Merge pull request #84 from specta/develop
Browse files Browse the repository at this point in the history
Release Expecta 0.3.0
  • Loading branch information
tonyarnold committed Mar 11, 2014
2 parents 3545a3e + 10b6439 commit 5fac9f0
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 36 deletions.
6 changes: 6 additions & 0 deletions 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
======

Expand Down
6 changes: 3 additions & 3 deletions 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'
Expand All @@ -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
10 changes: 4 additions & 6 deletions Expecta.xcodeproj/project.pbxproj
Expand Up @@ -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 = "";
Expand All @@ -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 = "";
Expand Down Expand Up @@ -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;
};
Expand All @@ -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;
Expand All @@ -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 = "";
Expand All @@ -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 = "";
Expand Down
61 changes: 34 additions & 27 deletions 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

Expand All @@ -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);
Expand All @@ -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
```

Expand Down Expand Up @@ -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
Expand All @@ -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`.
});
}
Expand Down

0 comments on commit 5fac9f0

Please sign in to comment.